Print this page
fix copyright fubar, reduce diffs
15254 %ymm registers not restored after signal handler
15367 x86 getfpregs() summons corrupting %xmm ghosts
15333 want x86 /proc xregs support (libc_db, libproc, mdb, etc.)
15336 want libc functions for extended ucontext_t
15334 want ps_lwphandle-specific reg routines
15328 FPU_CW_INIT mistreats reserved bit
15335 i86pc fpu_subr.c isn't really platform-specific
15332 setcontext(2) isn't actually noreturn
15331 need <sys/stdalign.h>
Change-Id: I7060aa86042dfb989f77fc3323c065ea2eafa9ad
Conflicts:
    usr/src/uts/common/fs/proc/prcontrol.c
    usr/src/uts/intel/os/archdep.c
    usr/src/uts/intel/sys/ucontext.h
    usr/src/uts/intel/syscall/getcontext.c
        
*** 18,32 ****
   *
   * CDDL HEADER END
   */
  /*
   * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
-  * Copyright (c) 2017, Joyent, Inc.
   * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
   * Copyright 2018, Joyent, Inc.
!  * Copyright 2020 Oxide Computer Company
   */
  
  /*
   * Kernel memory allocator, as described in the following two papers and a
   * statement about the consolidator:
--- 18,31 ----
   *
   * CDDL HEADER END
   */
  /*
   * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
   * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
   * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
   * Copyright 2018, Joyent, Inc.
!  * Copyright 2023 Oxide Computer Company
   */
  
  /*
   * Kernel memory allocator, as described in the following two papers and a
   * statement about the consolidator:
*** 2818,2827 ****
--- 2817,2852 ----
          ASSERT(head == NULL);
          ASSERT(nbufs == 0);
          mutex_enter(&cp->cache_lock);
  }
  
+ /*
+  * kmem_rezalloc() is currently considered private until we sort out how we want
+  * to handle realloc vs. reallocf style interfaces.
+  */
+ void *
+ kmem_rezalloc(void *oldbuf, size_t oldsize, size_t newsize, int kmflag)
+ {
+         void *newbuf = kmem_alloc(newsize, kmflag);
+         if (newbuf == NULL) {
+                 return (NULL);
+         }
+ 
+         bcopy(oldbuf, newbuf, MIN(oldsize, newsize));
+         if (newsize > oldsize) {
+                 void *start = (void *)((uintptr_t)newbuf + oldsize);
+                 bzero(start, newsize - oldsize);
+         }
+ 
+         if (oldbuf != NULL) {
+                 ASSERT3U(oldsize, !=, 0);
+                 kmem_free(oldbuf, oldsize);
+         }
+ 
+         return (newbuf);
+ }
+ 
  void *
  kmem_zalloc(size_t size, int kmflag)
  {
          size_t index;
          void *buf;