Print this page
8956 Implement KPTI
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>


   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 /*
  23  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2017 Joyent, Inc.
  25  */
  26 
  27 #ifndef _SYS_ARCHSYSTM_H
  28 #define _SYS_ARCHSYSTM_H
  29 
  30 /*
  31  * A selection of ISA-dependent interfaces
  32  */
  33 
  34 #include <vm/seg_enum.h>
  35 #include <vm/page.h>
  36 
  37 #ifdef __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #ifdef _KERNEL
  42 
  43 extern greg_t getfp(void);
  44 extern int getpil(void);


  63 extern kmem_cache_t *fpsave_cachep;
  64 
  65 extern void cli(void);
  66 extern void sti(void);
  67 
  68 extern void tenmicrosec(void);
  69 
  70 extern void restore_int_flag(ulong_t);
  71 extern void intr_restore(ulong_t);
  72 extern ulong_t clear_int_flag(void);
  73 extern ulong_t intr_clear(void);
  74 extern ulong_t getflags(void);
  75 extern int interrupts_enabled(void);
  76 
  77 extern void int3(void);
  78 extern void int18(void);
  79 extern void int20(void);
  80 extern void int_cmci(void);
  81 
  82 #if defined(__amd64)
  83 extern void sys_syscall();
  84 extern void sys_syscall32();
  85 extern void sys_lcall32();
  86 extern void sys_syscall_int();
  87 extern void brand_sys_syscall();
  88 extern void brand_sys_syscall32();
  89 extern void brand_sys_syscall_int();

  90 extern int update_sregs();
  91 extern void reset_sregs();
  92 #elif defined(__i386)
  93 extern void sys_call();

  94 extern void brand_sys_call();
  95 #endif
  96 extern void sys_sysenter();

  97 extern void _sys_sysenter_post_swapgs();
  98 extern void brand_sys_sysenter();

  99 extern void _brand_sys_sysenter_post_swapgs();
 100 
 101 extern void dosyscall(void);
 102 
 103 extern void bind_hwcap(void);
 104 
 105 extern uint16_t inw(int port);
 106 extern uint32_t inl(int port);
 107 extern void outw(int port, uint16_t value);
 108 extern void outl(int port, uint32_t value);
 109 
 110 extern void pc_reset(void) __NORETURN;
 111 extern void efi_reset(void) __NORETURN;
 112 extern void reset(void) __NORETURN;
 113 extern int goany(void);
 114 
 115 extern void setgregs(klwp_t *, gregset_t);
 116 extern void getgregs(klwp_t *, gregset_t);
 117 extern void setfpregs(klwp_t *, fpregset_t *);
 118 extern void getfpregs(klwp_t *, fpregset_t *);




   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 /*
  23  * Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
  24  * Copyright 2018 Joyent, Inc.
  25  */
  26 
  27 #ifndef _SYS_ARCHSYSTM_H
  28 #define _SYS_ARCHSYSTM_H
  29 
  30 /*
  31  * A selection of ISA-dependent interfaces
  32  */
  33 
  34 #include <vm/seg_enum.h>
  35 #include <vm/page.h>
  36 
  37 #ifdef __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 #ifdef _KERNEL
  42 
  43 extern greg_t getfp(void);
  44 extern int getpil(void);


  63 extern kmem_cache_t *fpsave_cachep;
  64 
  65 extern void cli(void);
  66 extern void sti(void);
  67 
  68 extern void tenmicrosec(void);
  69 
  70 extern void restore_int_flag(ulong_t);
  71 extern void intr_restore(ulong_t);
  72 extern ulong_t clear_int_flag(void);
  73 extern ulong_t intr_clear(void);
  74 extern ulong_t getflags(void);
  75 extern int interrupts_enabled(void);
  76 
  77 extern void int3(void);
  78 extern void int18(void);
  79 extern void int20(void);
  80 extern void int_cmci(void);
  81 
  82 #if defined(__amd64)
  83 extern void sys_syscall(), tr_sys_syscall();
  84 extern void sys_syscall32(), tr_sys_syscall32();
  85 extern void sys_lcall32();
  86 extern void sys_syscall_int();
  87 extern void tr_sys_syscall_int();
  88 extern void brand_sys_syscall(), tr_brand_sys_syscall();
  89 extern void brand_sys_syscall32(), tr_brand_sys_syscall32();
  90 extern void brand_sys_syscall_int(), tr_brand_sys_syscall_int();
  91 extern int update_sregs();
  92 extern void reset_sregs();
  93 #elif defined(__i386)
  94 extern void sys_call();
  95 extern void tr_sys_call();
  96 extern void brand_sys_call();
  97 #endif
  98 extern void sys_sysenter();
  99 extern void tr_sys_sysenter();
 100 extern void _sys_sysenter_post_swapgs();
 101 extern void brand_sys_sysenter();
 102 extern void tr_brand_sys_sysenter();
 103 extern void _brand_sys_sysenter_post_swapgs();
 104 
 105 extern void dosyscall(void);
 106 
 107 extern void bind_hwcap(void);
 108 
 109 extern uint16_t inw(int port);
 110 extern uint32_t inl(int port);
 111 extern void outw(int port, uint16_t value);
 112 extern void outl(int port, uint32_t value);
 113 
 114 extern void pc_reset(void) __NORETURN;
 115 extern void efi_reset(void) __NORETURN;
 116 extern void reset(void) __NORETURN;
 117 extern int goany(void);
 118 
 119 extern void setgregs(klwp_t *, gregset_t);
 120 extern void getgregs(klwp_t *, gregset_t);
 121 extern void setfpregs(klwp_t *, fpregset_t *);
 122 extern void getfpregs(klwp_t *, fpregset_t *);