3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright (c) 2017, Joyent, Inc.  All rights reserved.
  24  */
  25 
  26 #include <sys/types.h>
  27 #include <sys/kstat.h>
  28 #include <sys/param.h>
  29 #include <sys/stack.h>
  30 #include <sys/regset.h>
  31 #include <sys/thread.h>
  32 #include <sys/proc.h>
  33 #include <sys/procfs_isa.h>
  34 #include <sys/kmem.h>
  35 #include <sys/cpuvar.h>
  36 #include <sys/systm.h>
  37 #include <sys/machpcb.h>
  38 #include <sys/machasi.h>
  39 #include <sys/vis.h>
  40 #include <sys/fpu/fpusystm.h>
  41 #include <sys/cpu_module.h>
  42 #include <sys/privregs.h>
 
 
  46 #include <sys/time.h>
  47 #include <sys/clock.h>
  48 #include <sys/cmp.h>
  49 #include <sys/platform_module.h>
  50 #include <sys/bl.h>
  51 #include <sys/nvpair.h>
  52 #include <sys/kdi_impl.h>
  53 #include <sys/machsystm.h>
  54 #include <sys/sysmacros.h>
  55 #include <sys/promif.h>
  56 #include <sys/pool_pset.h>
  57 #include <sys/mem.h>
  58 #include <sys/dumphdr.h>
  59 #include <vm/seg_kmem.h>
  60 #include <sys/hold_page.h>
  61 #include <sys/cpu.h>
  62 #include <sys/ivintr.h>
  63 #include <sys/clock_impl.h>
  64 #include <sys/machclock.h>
  65 
  66 int maxphys = MMU_PAGESIZE * 16;        /* 128k */
  67 int klustsize = MMU_PAGESIZE * 16;      /* 128k */
  68 
  69 /*
  70  * Initialize kernel thread's stack.
  71  */
  72 caddr_t
  73 thread_stk_init(caddr_t stk)
  74 {
  75         kfpu_t *fp;
  76         ulong_t align;
  77 
  78         /* allocate extra space for floating point state */
  79         stk -= SA(sizeof (kfpu_t) + GSR_SIZE);
  80         align = (uintptr_t)stk & 0x3f;
  81         stk -= align;           /* force v9_fpu to be 16 byte aligned */
  82         fp = (kfpu_t *)stk;
  83         fp->fpu_fprs = 0;
  84 
  85         stk -= SA(MINFRAME);
  86         return (stk);
 
 819          * This cpu is now safe.
 820          */
 821         *safe = PAUSE_WAIT;
 822         membar_enter(); /* make sure stores are flushed */
 823 
 824         /*
 825          * Now we wait.  When we are allowed to continue, safe
 826          * will be set to PAUSE_IDLE.
 827          */
 828         while (*safe != PAUSE_IDLE)
 829                 SMT_PAUSE();
 830 }
 831 
 832 /*ARGSUSED*/
 833 int
 834 plat_mem_do_mmio(struct uio *uio, enum uio_rw rw)
 835 {
 836         return (ENOTSUP);
 837 }
 838 
 839 /* cpu threshold for compressed dumps */
 840 #ifdef sun4v
 841 uint_t dump_plat_mincpu_default = DUMP_PLAT_SUN4V_MINCPU;
 842 #else
 843 uint_t dump_plat_mincpu_default = DUMP_PLAT_SUN4U_MINCPU;
 844 #endif
 845 
 846 int
 847 dump_plat_addr()
 848 {
 849         return (0);
 850 }
 851 
 852 void
 853 dump_plat_pfn()
 854 {
 855 }
 856 
 857 /* ARGSUSED */
 858 int
 859 dump_plat_data(void *dump_cdata)
 860 {
 861         return (0);
 862 }
 863 
 864 /* ARGSUSED */
 865 int
 
 | 
 
 
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
  24  * Copyright (c) 2017, Joyent, Inc.  All rights reserved.
  25  */
  26 
  27 #include <sys/types.h>
  28 #include <sys/kstat.h>
  29 #include <sys/param.h>
  30 #include <sys/stack.h>
  31 #include <sys/regset.h>
  32 #include <sys/thread.h>
  33 #include <sys/proc.h>
  34 #include <sys/procfs_isa.h>
  35 #include <sys/kmem.h>
  36 #include <sys/cpuvar.h>
  37 #include <sys/systm.h>
  38 #include <sys/machpcb.h>
  39 #include <sys/machasi.h>
  40 #include <sys/vis.h>
  41 #include <sys/fpu/fpusystm.h>
  42 #include <sys/cpu_module.h>
  43 #include <sys/privregs.h>
 
 
  47 #include <sys/time.h>
  48 #include <sys/clock.h>
  49 #include <sys/cmp.h>
  50 #include <sys/platform_module.h>
  51 #include <sys/bl.h>
  52 #include <sys/nvpair.h>
  53 #include <sys/kdi_impl.h>
  54 #include <sys/machsystm.h>
  55 #include <sys/sysmacros.h>
  56 #include <sys/promif.h>
  57 #include <sys/pool_pset.h>
  58 #include <sys/mem.h>
  59 #include <sys/dumphdr.h>
  60 #include <vm/seg_kmem.h>
  61 #include <sys/hold_page.h>
  62 #include <sys/cpu.h>
  63 #include <sys/ivintr.h>
  64 #include <sys/clock_impl.h>
  65 #include <sys/machclock.h>
  66 
  67 volatile int maxphys = MMU_PAGESIZE * 16; /* 128k */
  68 int klustsize = MMU_PAGESIZE * 16;      /* 128k */
  69 
  70 /*
  71  * Initialize kernel thread's stack.
  72  */
  73 caddr_t
  74 thread_stk_init(caddr_t stk)
  75 {
  76         kfpu_t *fp;
  77         ulong_t align;
  78 
  79         /* allocate extra space for floating point state */
  80         stk -= SA(sizeof (kfpu_t) + GSR_SIZE);
  81         align = (uintptr_t)stk & 0x3f;
  82         stk -= align;           /* force v9_fpu to be 16 byte aligned */
  83         fp = (kfpu_t *)stk;
  84         fp->fpu_fprs = 0;
  85 
  86         stk -= SA(MINFRAME);
  87         return (stk);
 
 820          * This cpu is now safe.
 821          */
 822         *safe = PAUSE_WAIT;
 823         membar_enter(); /* make sure stores are flushed */
 824 
 825         /*
 826          * Now we wait.  When we are allowed to continue, safe
 827          * will be set to PAUSE_IDLE.
 828          */
 829         while (*safe != PAUSE_IDLE)
 830                 SMT_PAUSE();
 831 }
 832 
 833 /*ARGSUSED*/
 834 int
 835 plat_mem_do_mmio(struct uio *uio, enum uio_rw rw)
 836 {
 837         return (ENOTSUP);
 838 }
 839 
 840 int
 841 dump_plat_addr()
 842 {
 843         return (0);
 844 }
 845 
 846 void
 847 dump_plat_pfn()
 848 {
 849 }
 850 
 851 /* ARGSUSED */
 852 int
 853 dump_plat_data(void *dump_cdata)
 854 {
 855         return (0);
 856 }
 857 
 858 /* ARGSUSED */
 859 int
 
 |