17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*2b616c6cSwesolows * Common Development and Distribution License (the "License"). 6*2b616c6cSwesolows * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21*2b616c6cSwesolows 227c478bd9Sstevel@tonic-gate /* 23*2b616c6cSwesolows * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_ARCHSYSTM_H 287c478bd9Sstevel@tonic-gate #define _SYS_ARCHSYSTM_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gate /* 337c478bd9Sstevel@tonic-gate * A selection of ISA-dependent interfaces 347c478bd9Sstevel@tonic-gate */ 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 377c478bd9Sstevel@tonic-gate extern "C" { 387c478bd9Sstevel@tonic-gate #endif 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #if defined(_KERNEL) && !defined(_ASM) 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate #include <sys/types.h> 437c478bd9Sstevel@tonic-gate #include <sys/regset.h> 447c478bd9Sstevel@tonic-gate #include <sys/model.h> 45*2b616c6cSwesolows #if defined(__GNUC__) && defined(_ASM_INLINES) 46*2b616c6cSwesolows #include <asm/flush.h> 47*2b616c6cSwesolows #endif 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate extern greg_t getfp(void); 507c478bd9Sstevel@tonic-gate extern greg_t getpsr(void); 517c478bd9Sstevel@tonic-gate extern uint_t getpil(void); 527c478bd9Sstevel@tonic-gate extern void setpil(uint_t); 537c478bd9Sstevel@tonic-gate extern greg_t gettbr(void); 547c478bd9Sstevel@tonic-gate extern void realsigprof(int, int); 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate extern uintptr_t shm_alignment; 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate struct proc; 597c478bd9Sstevel@tonic-gate struct _klwp; 607c478bd9Sstevel@tonic-gate extern void xregrestore(struct _klwp *, int); 617c478bd9Sstevel@tonic-gate extern int copy_return_window(int); 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate extern void setgwins(struct _klwp *, gwindows_t *); 647c478bd9Sstevel@tonic-gate extern void getgwins(struct _klwp *, gwindows_t *); 657c478bd9Sstevel@tonic-gate extern void setgwins32(struct _klwp *, gwindows32_t *); 667c478bd9Sstevel@tonic-gate extern void getgwins32(struct _klwp *, gwindows32_t *); 677c478bd9Sstevel@tonic-gate extern void setasrs(struct _klwp *, asrset_t); 687c478bd9Sstevel@tonic-gate extern void getasrs(struct _klwp *, asrset_t); 697c478bd9Sstevel@tonic-gate extern void setfpasrs(struct _klwp *, asrset_t); 707c478bd9Sstevel@tonic-gate extern void getfpasrs(struct _klwp *, asrset_t); 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate extern void setgregs(struct _klwp *, gregset_t); 737c478bd9Sstevel@tonic-gate extern void getgregs(struct _klwp *, gregset_t); 747c478bd9Sstevel@tonic-gate extern void setfpregs(struct _klwp *, fpregset_t *); 757c478bd9Sstevel@tonic-gate extern void getfpregs(struct _klwp *, fpregset_t *); 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 787c478bd9Sstevel@tonic-gate extern void getgregs32(struct _klwp *, gregset32_t); 797c478bd9Sstevel@tonic-gate extern void setfpregs32(struct _klwp *, fpregset32_t *); 807c478bd9Sstevel@tonic-gate extern void getfpregs32(struct _klwp *, fpregset32_t *); 817c478bd9Sstevel@tonic-gate #endif 827c478bd9Sstevel@tonic-gate 837c478bd9Sstevel@tonic-gate extern void vac_flushall(void); 847c478bd9Sstevel@tonic-gate 857c478bd9Sstevel@tonic-gate extern void bind_hwcap(void); 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate extern u_longlong_t gettick(void); 887c478bd9Sstevel@tonic-gate extern uint64_t gettick_counter(void); 897c478bd9Sstevel@tonic-gate extern int xcopyin_little(const void *, void *, size_t); 907c478bd9Sstevel@tonic-gate extern int xcopyout_little(const void *, void *, size_t); 917c478bd9Sstevel@tonic-gate extern void xregs_getgfiller(klwp_id_t lwp, caddr_t xrp); 927c478bd9Sstevel@tonic-gate extern void xregs_setgfiller(klwp_id_t lwp, caddr_t xrp); 937c478bd9Sstevel@tonic-gate extern void xregs_getfpfiller(klwp_id_t lwp, caddr_t xrp); 947c478bd9Sstevel@tonic-gate extern void xregs_setfpfiller(klwp_id_t lwp, caddr_t xrp); 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate struct ucontext; 977c478bd9Sstevel@tonic-gate extern void xregs_clrptr(struct _klwp *, struct ucontext *); 987c478bd9Sstevel@tonic-gate extern int xregs_hasptr(struct _klwp *, struct ucontext *); 997c478bd9Sstevel@tonic-gate extern caddr_t xregs_getptr(struct _klwp *, struct ucontext *); 1007c478bd9Sstevel@tonic-gate extern void xregs_setptr(struct _klwp *, struct ucontext *, caddr_t); 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 1037c478bd9Sstevel@tonic-gate struct ucontext32; 1047c478bd9Sstevel@tonic-gate extern void xregs_clrptr32(struct _klwp *, struct ucontext32 *); 1057c478bd9Sstevel@tonic-gate extern int xregs_hasptr32(struct _klwp *, struct ucontext32 *); 1067c478bd9Sstevel@tonic-gate extern caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *); 1077c478bd9Sstevel@tonic-gate extern void xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t); 1087c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */ 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gate extern void xregs_getgregs(struct _klwp *, caddr_t); 1117c478bd9Sstevel@tonic-gate extern void xregs_getfpregs(struct _klwp *, caddr_t); 1127c478bd9Sstevel@tonic-gate extern void xregs_get(struct _klwp *, caddr_t); 1137c478bd9Sstevel@tonic-gate extern void xregs_setgregs(struct _klwp *, caddr_t); 1147c478bd9Sstevel@tonic-gate extern void xregs_setfpregs(struct _klwp *, caddr_t); 1157c478bd9Sstevel@tonic-gate extern void xregs_set(struct _klwp *, caddr_t); 1167c478bd9Sstevel@tonic-gate extern int xregs_getsize(struct proc *); 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gate extern void doflush(void *); 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate extern uint_t cpu_hwcap_flags; 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate #endif /* _KERNEL && !_ASM */ 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate #if defined(_KERNEL) 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate /* 1287c478bd9Sstevel@tonic-gate * For binary compatability with SPARC/Solaris 1. Needed in the 1297c478bd9Sstevel@tonic-gate * sparc assembly files. 1307c478bd9Sstevel@tonic-gate */ 1317c478bd9Sstevel@tonic-gate #define OSYS_mmap 71 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1367c478bd9Sstevel@tonic-gate } 1377c478bd9Sstevel@tonic-gate #endif 1387c478bd9Sstevel@tonic-gate 1397c478bd9Sstevel@tonic-gate #endif /* _SYS_ARCHSYSTM_H */ 140