Home | History | Annotate | Download | only in sys
      1 /*
      2  * CDDL HEADER START
      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 /*
     23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #ifndef _SYS_ARCHSYSTM_H
     28 #define	_SYS_ARCHSYSTM_H
     29 
     30 /*
     31  * A selection of ISA-dependent interfaces
     32  */
     33 
     34 #ifdef __cplusplus
     35 extern "C" {
     36 #endif
     37 
     38 #if defined(_KERNEL) && !defined(_ASM)
     39 
     40 #include <sys/types.h>
     41 #include <sys/regset.h>
     42 #include <sys/model.h>
     43 #if defined(__GNUC__) && defined(_ASM_INLINES)
     44 #include <asm/flush.h>
     45 #endif
     46 
     47 extern greg_t getfp(void);
     48 extern greg_t getpsr(void);
     49 extern uint_t getpil(void);
     50 extern void setpil(uint_t);
     51 extern greg_t gettbr(void);
     52 
     53 extern uintptr_t shm_alignment;
     54 
     55 struct proc;
     56 struct _klwp;
     57 extern void xregrestore(struct _klwp *, int);
     58 extern int  copy_return_window(int);
     59 
     60 extern void setgwins(struct _klwp *, gwindows_t *);
     61 extern void getgwins(struct _klwp *, gwindows_t *);
     62 extern void setgwins32(struct _klwp *, gwindows32_t *);
     63 extern void getgwins32(struct _klwp *, gwindows32_t *);
     64 extern void setasrs(struct _klwp *, asrset_t);
     65 extern void getasrs(struct _klwp *, asrset_t);
     66 extern void setfpasrs(struct _klwp *, asrset_t);
     67 extern void getfpasrs(struct _klwp *, asrset_t);
     68 
     69 extern void setgregs(struct _klwp *, gregset_t);
     70 extern void getgregs(struct _klwp *, gregset_t);
     71 extern void setfpregs(struct _klwp *, fpregset_t *);
     72 extern void getfpregs(struct _klwp *, fpregset_t *);
     73 
     74 #ifdef _SYSCALL32_IMPL
     75 extern void getgregs32(struct _klwp *, gregset32_t);
     76 extern void setfpregs32(struct _klwp *, fpregset32_t *);
     77 extern void getfpregs32(struct _klwp *, fpregset32_t *);
     78 #endif
     79 
     80 extern void vac_flushall(void);
     81 
     82 extern void bind_hwcap(void);
     83 
     84 extern u_longlong_t gettick(void);
     85 extern uint64_t	gettick_counter(void);
     86 extern int xcopyin_little(const void *, void *, size_t);
     87 extern int xcopyout_little(const void *, void *, size_t);
     88 extern void xregs_getgfiller(struct _klwp *lwp, caddr_t xrp);
     89 extern void xregs_setgfiller(struct _klwp *lwp, caddr_t xrp);
     90 extern void xregs_getfpfiller(struct _klwp *lwp, caddr_t xrp);
     91 extern void xregs_setfpfiller(struct _klwp *lwp, caddr_t xrp);
     92 
     93 struct ucontext;
     94 extern	void	xregs_clrptr(struct _klwp *, struct ucontext *);
     95 extern	int	xregs_hasptr(struct _klwp *, struct ucontext *);
     96 extern	caddr_t	xregs_getptr(struct _klwp *, struct ucontext *);
     97 extern	void	xregs_setptr(struct _klwp *, struct ucontext *, caddr_t);
     98 
     99 #ifdef _SYSCALL32_IMPL
    100 struct	ucontext32;
    101 extern	void	xregs_clrptr32(struct _klwp *, struct ucontext32 *);
    102 extern	int	xregs_hasptr32(struct _klwp *, struct ucontext32 *);
    103 extern	caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *);
    104 extern	void	xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t);
    105 #endif /* _SYSCALL32_IMPL */
    106 
    107 extern	void	xregs_getgregs(struct _klwp *, caddr_t);
    108 extern	void	xregs_getfpregs(struct _klwp *, caddr_t);
    109 extern	void	xregs_get(struct _klwp *, caddr_t);
    110 extern	void	xregs_setgregs(struct _klwp *, caddr_t);
    111 extern	void	xregs_setfpregs(struct _klwp *, caddr_t);
    112 extern	void	xregs_set(struct _klwp *, caddr_t);
    113 extern	int	xregs_getsize(struct proc *);
    114 
    115 extern void doflush(void *);
    116 
    117 extern uint_t cpu_hwcap_flags;
    118 
    119 extern uint_t weakest_mem_model;
    120 
    121 #define	cpr_dprintf prom_printf
    122 
    123 #endif /* _KERNEL && !_ASM */
    124 
    125 
    126 #if defined(_KERNEL)
    127 
    128 /*
    129  * For binary compatability with SPARC/Solaris 1.  Needed in the
    130  * sparc assembly files.
    131  */
    132 #define	OSYS_mmap	71
    133 
    134 #endif /* _KERNEL */
    135 
    136 #ifdef __cplusplus
    137 }
    138 #endif
    139 
    140 #endif	/* _SYS_ARCHSYSTM_H */
    141