PSARC 1994/196 PowerPC Header Files (modified files) Bill Taylor @ West usr/src/head/alloca.h usr/src/head/arpa/nameser.h usr/src/head/float.h usr/src/head/ieeefp.h usr/src/head/nan.h usr/src/head/setjmp.h usr/src/head/stdarg.h usr/src/head/stdio.h usr/src/head/values.h usr/src/head/varargs.h usr/src/uts/common/sys/elf_ppc.h usr/src/uts/common/rpc/auth.h usr/src/uts/common/sys/dklabel.h usr/src/uts/common/sys/elf.h usr/src/uts/common/sys/fs/hsfs_isospec.h usr/src/uts/common/sys/fs/hsfs_spec.h usr/src/uts/common/sys/isa_defs.h usr/src/uts/common/sys/scsi/impl/pkt_wrapper.h usr/src/uts/common/sys/sunddi.h usr/src/uts/common/sys/syscall.h usr/src/uts/common/sys/user.h usr/src/uts/common/sys/varargs.h ===================================================================== ===== ===== ===== Common header files that need to change for PowerPC ===== ===== ===== ===== < means old contents ===== ===== > means new contents ===== ===== ===== ===================================================================== **************************************************************** **** usr/src/head/alloca.h **** **** **** **** alloca() #defined to be __builtin_alloca **** **** as on SPARC and x86 **** **************************************************************** 2c2 < * Copyright (c) 1991, 1993, by Sun Microsystems, Inc. --- > * Copyright (c) 1991, 1993, 1994, by Sun Microsystems, Inc. 8c8 < #pragma ident "@(#)alloca.h 1.5 93/09/27 SMI" --- > #pragma ident "@(#)alloca.h 1.6 94/02/10 SMI" 32c32 < defined(i386) || defined(__i386) --- > defined(i386) || defined(__i386) || defined(ppc) || defined(__ppc) **************************************************************** **** usr/src/head/arpa/nameser.h **** **** **** **** Common Source Policy compliance **** **** **** **************************************************************** 25c25 < * (c) 1986,1987,1988,1989 Sun Microsystems, Inc --- > * (c) 1986,1987,1988,1989,1994 Sun Microsystems, Inc 34c34 < #pragma ident "@(#)nameser.h 1.14 94/01/07 SMI" /* SVr4.0 1.1 */ --- > #pragma ident "@(#)nameser.h 1.15 94/02/11 SMI" /* SVr4.0 1.1 */ 35a36,37 > #include > 144c146 < #if defined(sparc) || defined(__sparc) || defined(BIT_ZERO_ON_LEFT) --- > #if defined(_BIT_FIELDS_HTOL) || defined(BIT_ZERO_ON_LEFT) 158c160 < #if defined(i386) || defined(__i386) || defined(BIT_ZERO_ON_RIGHT) --- > #if defined(_BIT_FIELDS_LTOH) || defined(BIT_ZERO_ON_RIGHT) **************************************************************** **** usr/src/head/float.h **** **** **** **** PowerPC uses 128-bit "quad" extended FP format. **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)float.h 1.11 93/09/15 SMI" /* SVr4.0 1.7 */ --- > #pragma ident "@(#)float.h 1.12 94/02/10 SMI" /* SVr4.0 1.7 */ 71c71 < #elif defined(sparc) || defined(__sparc) --- > #elif defined(sparc) || defined(__sparc) || defined(ppc) || defined(__ppc) **************************************************************** **** usr/src/head/ieeefp.h **** **** **** **** PowerPC FPU rounding modes and exception bits **** **** are the same as on SPARC. **** **************************************************************** 14c14 < #pragma ident "@(#)ieeefp.h 1.12 93/11/01 SMI" /* SVr4.0 1.18 */ --- > #pragma ident "@(#)ieeefp.h 1.13 94/02/10 SMI" /* SVr4.0 1.18 */ 53a54,59 > #if defined(__STDC__) > #define __ppc_conditional #machine(ppc) || defined(__ppc) > #else > #define __ppc_conditional defined(ppc) || defined(__ppc) > #endif > 102c108 < #if __sparc_conditional --- > #if __sparc_conditional || __ppc_conditional 164c170 < #if __sparc_conditional --- > #if __sparc_conditional || __ppc_conditional **************************************************************** **** usr/src/head/nan.h **** **** **** **** Common Source Policy compliance **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)nan.h 1.8 92/07/14 SMI" /* SVr4.0 1.12.1.6 */ --- > #pragma ident "@(#)nan.h 1.9 94/02/10 SMI" /* SVr4.0 1.12.1.6 */ 18a19,20 > #include > 24c26 < #if !i286 && !i386 --- > #if !i286 && defined(_BIT_FIELDS_HTOL) 47c49 < #if i386 --- > #if !i286 && defined(_BIT_FIELDS_LTOH) **************************************************************** **** usr/src/head/setjmp.h **** **** **** **** PowerPC ABI values **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)setjmp.h 1.14 93/09/27 SMI" /* SVr4.0 1.9.2.9 */ --- > #pragma ident "@(#)setjmp.h 1.15 94/03/21 SMI" /* SVr4.0 1.9.2.9 */ 41a42,44 > #elif #machine(ppc) || defined(__ppc) > #define _JBLEN 64 /* ABI value */ > #define _SIGJBLEN 128 /* ABI value */ 53a57,59 > #elif defined(ppc) || defined(__ppc) > #define _JBLEN 64 /* ABI value */ > #define _SIGJBLEN 128 /* ABI value */ **************************************************************** **** usr/src/head/stdarg.h **** **** **** **** PowerPC ABI for varargs/stdarg **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)stdarg.h 1.11 94/01/05 SMI" /* SVr4.0 1.8 */ --- > #pragma ident "@(#)stdarg.h 1.20 94/04/29 SMI" /* SVr4.0 1.8 */ 37a38,45 > #if defined(__ppc) > typedef struct { > unsigned long vararg_usage_info; > unsigned long *overflow_area; > unsigned long *arg_save_area; > } va_list[1]; > > #else 39a48 > #endif 43a53,59 > #if defined(__ppc) > extern void __builtin_va_info(va_list); > extern void *__va_arg(va_list, int); > /*** the __va_start() as a work-around for a compiler bug ***/ > #define va_start(list, name) __builtin_va_info(list);__va_start(list) > #define va_arg(list, mode) ((mode *)__va_arg(list, __va_INFO((mode *) 0)))[0] > #else 45a62 > #endif 46a64,75 > #if defined(__ppc) > /* extra macros and functions for PowerPC */ > /* __va_copy is a necessary architecture dependent extension */ > #define __va_copy(to, from) ((to)[0] = (from)[0]) > > /* these library functions have been added for execl() */ > void ** __va_list_to_vec(va_list arglist); > void __va_vec_free(void **argvec); > #elif defined(__sparc) || defined(__i386) > #define __va_copy(to, from) ((to) = (from)) > #endif > 55c84 < #define va_arg(list, mode) ((mode *)(list = (char *)list + sizeof (mode)))[-1] --- > #define va_arg(list, mode) ((mode *)(list += sizeof (mode)))[-1] **************************************************************** **** usr/src/head/stdio.h **** **** **** **** PowerPC ABI values **** **** **** **************************************************************** 15c15 < #pragma ident "@(#)stdio.h 1.33 94/03/28 SMI" /* SVr4.0 2.34.1.2 */ --- > #pragma ident "@(#)stdio.h 1.34 94/06/03 SMI" /* SVr4.0 2.34.1.2 */ 51a52,53 > #elif #machine(ppc) || defined(__ppc) > #define _NFILE 3 /* initial number of streams: PowerPC ABI */ 57a60,61 > #elif defined(ppc) || defined(__ppc) > #define _NFILE 3 /* initial number of streams: PowerPC ABI */ **************************************************************** **** usr/src/head/values.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)values.h 1.11 93/11/01 SMI" /* SVr4.0 1.33 */ --- > #pragma ident "@(#)values.h 1.12 94/02/10 SMI" /* SVr4.0 1.33 */ 86c86,87 < #if #machine(i386) || defined(__i386) || #machine(sparc) || defined(__sparc) --- > #if #machine(i386) || #machine(sparc) || #machine(ppc) || \ > defined(__i386) || defined(__sparc) || defined(__ppc) 106c107,108 < #if defined(i386) || defined(__i386) || defined(sparc) || defined(__sparc) --- > #if defined(i386) || defined(sparc) || defined(ppc) || \ > defined(__i386) || defined(__sparc) || defined(__ppc) **************************************************************** **** usr/src/head/varargs.h **** **** **** **** PowerPC ABI for varargs/stdarg **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)varargs.h 1.18 94/01/27 SMI" /* SVr4.0 1.4.1.5 */ --- > #pragma ident "@(#)varargs.h 1.19 94/06/03 SMI" 35a36,42 > #if defined(__ppc) > typedef struct { > unsigned long vararg_usage_info; > unsigned long *overflow_area; > unsigned long *arg_save_area; > } va_list[1]; > #else 37a45 > #endif 44a53,57 > #if defined(__ppc) > extern void __builtin_va_info(va_list); > /*** the __va_start() is a work-around for a compiler bug ***/ > #define va_start(list) __builtin_va_info(list); __va_start(list); > #else 45a59 > #endif 49a64,67 > #if defined(__ppc) > extern void *__va_arg(va_list, int); > #define va_arg(list, mode) ((mode *)__va_arg(list, __va_INFO((mode *) 0)))[0] > #else 50a69 > #endif /*__ppc*/ 53a73,95 > > #if defined(__ppc) > /* extra macros and functions for PowerPC */ > /* __va_copy is a necessary architecture dependent extension */ > #define __va_copy(to, from) ((to)[0] = (from)[0]) > > /* these library functions have been added for execl() */ > void ** __va_list_to_vec(va_list arglist); > void __va_vec_free(void **argvec); > #elif defined(__sparc) || defined(__i386) > #define __va_copy(to, from) ((to) = (from)) > #endif > > #if defined(__ppc) > /* these library functions have been added for execl() */ > #if defined(__STDC__) > void **__va_list_to_vec(va_list); > void __va_vec_free(void **); > #else > void **__va_list_to_vec(); > void __va_vec_free(); > #endif > #endif /*__ppc*/ **************************************************************** **** usr/src/uts/common/rpc/auth.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 16c16 < #pragma ident "@(#)auth.h 1.25 94/02/07 SMI" --- > #pragma ident "@(#)auth.h 1.26 94/02/28 SMI" 57c57 < #if (mc68000 || sparc || vax || i386 || u3b2) --- > #if (mc68000 || sparc || vax || i386 || u3b2 || ppc) **************************************************************** **** usr/src/uts/common/sys/dklabel.h **** **** **** **** Part of the disk label project. **** **** **** **************************************************************** 8c8 < #pragma ident "@(#)dklabel.h 1.3 93/11/01 SMI" --- > #pragma ident "@(#)dklabel.h 1.4 94/04/15 SMI" 20c20 < #ifdef i386 --- > #if defined(i386) || defined(ppc) 32c32 < #ifdef i386 --- > #if defined(i386) || defined(ppc) 75c75 < #ifdef i386 --- > #if defined(i386) || defined(ppc) 111c111 < #elif defined(i386) --- > #elif defined(i386) || defined(ppc) 123c123 < #ifdef i386 --- > #if defined(i386) || defined(ppc) 166c166 < #ifdef i386 --- > #if defined(i386) || defined(ppc) **************************************************************** **** usr/src/uts/common/sys/elf.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 11c11 < #pragma ident "@(#)elf.h 1.15 93/11/01 SMI" /* SVr4.0 1.4 */ --- > #pragma ident "@(#)elf.h 1.19 94/01/14 SMI" /* SVr4.0 1.4 */ 100c100,103 < #define EM_NUM 8 --- > #define EM_MIPS 8 /* MIP RS3000 Big-Endian */ > #define EM_MIPS_RS4_BE 10 /* MIP RS4000 Big-Endian */ > #define EM_PPC 17 /* PowerPC */ > #define EM_NUM 18 299a303,306 > #endif > > #if defined(ELF_TARGET_ALL) || defined(ELF_TARGET_PPC) > #include **************************************************************** **** usr/src/uts/common/sys/elf_ppc.h **** **** **** **** New file **** **** **** **************************************************************** /* * Copyright (c) 1993 by Sun Microsystems, Inc. */ #ifndef _SYS_ELF_PPC_H #define _SYS_ELF_PPC_H #pragma ident "@(#)elf_ppc.h 1.4 94/03/24 SMI" #ifdef __cplusplus extern "C" { #endif #define R_PPC_NONE 0 /* relocation type */ #define R_PPC_ADDR32 1 #define R_PPC_ADDR24 2 #define R_PPC_ADDR16 3 #define R_PPC_ADDR16_LO 4 #define R_PPC_ADDR16_HI 5 #define R_PPC_ADDR16_HA 6 #define R_PPC_ADDR14 7 #define R_PPC_ADDR14_BRTAKEN 8 #define R_PPC_ADDR14_BRNTAKEN 9 #define R_PPC_REL24 10 #define R_PPC_REL14 11 #define R_PPC_REL14_BRTAKEN 12 #define R_PPC_REL14_BRNTAKEN 13 #define R_PPC_GOT16 14 #define R_PPC_GOT16_LO 15 #define R_PPC_GOT16_HI 16 #define R_PPC_GOT16_HA 17 #define R_PPC_PLT24 18 #define R_PPC_COPY 19 #define R_PPC_GLOB_DAT 20 #define R_PPC_JMP_SLOT 21 #define R_PPC_RELATIVE 22 #define R_PPC_UADDR32 23 #define R_PPC_UADDR16 24 #define R_PPC_NUM 25 /* must be >last */ #define ELF_PPC_MAXPGSZ 0x10000 /* maximum page size */ #ifdef __cplusplus } #endif #endif /* _SYS_ELF_PPC_H */ **************************************************************** **** usr/src/uts/common/sys/fs/hsfs_isospec.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 3c3 < * Copyright (c) 1989, 1990 by Sun Microsystem, Inc. --- > * Copyright (c) 1989-1994 by Sun Microsystems, Inc. All Rights Reserved. 9c9 < #pragma ident "@(#)hsfs_isospec.h 1.7 94/01/10 SMI" --- > #pragma ident "@(#)hsfs_isospec.h 1.8 94/02/04 SMI" 33a34,41 > #elif defined(ppc) > #if defined(_LITTLE_ENDIAN) > #define BOTH_SHORT(x) MSB_SHORT(x) > #define BOTH_INT(x) MSB_INT(x) > #else > #define BOTH_SHORT(x) LSB_SHORT(x) > #define BOTH_INT(x) LSB_INT(x) > #endif /* _LITTLE_ENDIAN */ **************************************************************** **** usr/src/uts/common/sys/fs/hsfs_spec.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 3c3 < * Copyright (c) 1989, 1990 by Sun Microsystem, Inc. --- > * Copyright (c) 1989-1994 by Sun Microsystems, Inc. All Rights Reserved. 9c9 < #pragma ident "@(#)hsfs_spec.h 1.8 94/01/05 SMI" --- > #pragma ident "@(#)hsfs_spec.h 1.9 94/02/04 SMI" 46a47,54 > #elif defined(ppc) > #if defined(_LITTLE_ENDIAN) > #define BOTH_SHORT(x) MSB_SHORT(x) > #define BOTH_INT(x) MSB_INT(x) > #else > #define BOTH_SHORT(x) LSB_SHORT(x) > #define BOTH_INT(x) LSB_INT(x) > #endif /* _LITTLE_ENDIAN */ **************************************************************** **** usr/src/uts/common/sys/isa_defs.h **** **** **** **** Added PowerPC to list of supported architectures **** **** **** **************************************************************** 8c8 < #pragma ident "@(#)isa_defs.h 1.1 93/07/01 SMI" --- > #pragma ident "@(#)isa_defs.h 1.2 94/02/10 SMI" 109a110,171 > > /* > * The following set of definitions characterize the Solaris on PowerPC systems. > * > * The feature test macro __ppc is generic for all processors implementing > * the PowerPC instruction set or a superset of it. Specifically, this > * includes all members of the 601, 603, 604, and 620 family of processors. > */ > #elif defined(__ppc) || defined(ppc) > > #if defined(__BIG_ENDIAN) > > /* > * Make sure that the ANSI-C "politically correct" symbol is defined. > */ > #if !defined(__ppc) > #define __ppc > #endif > > /* > * Define the appropriate "processor characteristics" > */ > #define _BIG_ENDIAN > #define _STACK_GROWS_DOWNWARD > #define _LONG_LONG_HTOL > #define _BIT_FIELDS_HTOL > #define _IEEE_754 > #define _CHAR_IS_SIGNED > > /* > * Define the appropriate "implementation choices". > */ > #define _SUNOS_VTOC_16 > > > #elif defined(__LITTLE_ENDIAN) > > /* > * Make sure that the ANSI-C "politically correct" symbol is defined. > */ > #if !defined(__ppc) > #define __ppc > #endif > > /* > * Define the appropriate "processor characteristics" > */ > #define _LITTLE_ENDIAN > #define _STACK_GROWS_DOWNWARD > #define _LONG_LONG_LTOH > #define _BIT_FIELDS_LTOH > #define _IEEE_754 > #define _CHAR_IS_SIGNED > > /* > * Define the appropriate "implementation choices". > */ > #define _SUNOS_VTOC_16 > > #else > #error One of {__BIG_ENDIAN, __LITTLE_ENDIAN} must be defined for ppc > #endif **************************************************************** **** usr/src/uts/common/sys/scsi/impl/pkt_wrapper.h **** **** **** **** PowerPC DMA on "prep" platform is the same as x86. **** **** **** **************************************************************** 8c8 < #pragma ident "@(#)pkt_wrapper.h 1.32 94/03/09 SMI" --- > #pragma ident "@(#)pkt_wrapper.h 1.34 94/05/18 SMI" 102c102,103 < #if defined(i386) --- > /* XXXPPC - this should really be an ifdef like, DMA_USES_PHYSADDR */ > #if defined(i386) || defined(ppc) 129c130 < #else --- > #else /* SPARC */ 159c160 < #endif /* defined(i386) */ --- > #endif /* defined(i386) || defined(ppc) */ **************************************************************** **** usr/src/uts/common/sys/sunddi.h **** **** **** **** PowerPC has need for DDI dma engine interface **** **** like the x86. **** **************************************************************** 8c8 < #pragma ident "@(#)sunddi.h 1.37 94/05/23 SMI" /* SVr4 */ --- > #pragma ident "@(#)sunddi.h 1.38 94/06/03 SMI" /* SVr4 */ 20c20 < #ifdef i386 --- > #if defined(i386) || defined(ppc) 39d38 < #ifdef i386 43d41 < #endif **************************************************************** **** usr/src/uts/common/sys/syscall.h **** **** **** **** A placeholder architecture system call added. Is **** **** this correct or not (x86 has it, SPARC does not)? **** **************************************************************** 11c11 < #pragma ident "@(#)syscall.h 1.38 93/07/07 SMI" /* from SVr4.0 1.17 */ --- > #pragma ident "@(#)syscall.h 1.39 94/04/08 SMI" /* from SVr4.0 1.17 */ 110a111 > #if defined(__sparc) 111a113,117 > #elif defined(__i386) > #define SYS_sysi86 50 > #elif defined(__ppc) > #define SYS_sysppc 50 > #endif **************************************************************** **** usr/src/uts/common/sys/user.h **** **** **** **** Structure member added to communicate where the **** **** auxiliary vector is. Computed in fastbuildstack() **** **** and used in setregs(). **** **************************************************************** 11c11 < #pragma ident "@(#)user.h 1.30 93/11/15 SMI" /* from SVr4.0 11.44 */ --- > #pragma ident "@(#)user.h 1.31 94/02/18 SMI" /* from SVr4.0 11.44 */ 116a117 > char **u_auxvp; **************************************************************** **** usr/src/uts/common/sys/varargs.h **** **** **** **** PowerPC ABI for varargs/stdarg **** **** **** **************************************************************** 1c1 < /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ --- > /* Copyright (c) 1988 AT&T */ 8,10c8 < /* Merges definitions from ICL version 5.5 (stdarg.h 6.1) */ < < #ifndef _SYS_VARARGS_H --- > #ifndef _SYS_VARARGS_H 13c11 < #pragma ident "@(#)varargs.h 1.16 93/11/29 SMI" /* UCB 4.1 83/05/03 */ --- > #pragma ident "@(#)varargs.h 1.22 94/04/27 SMI" 36,53c34,39 < #if defined(__STDC__) < < /* < * When __STDC__ is defined, this file provides stdarg semantics despite < * the name of the file. < */ < < #ifndef _VA_LIST < #define _VA_LIST < typedef void *va_list; < #endif < < #if (defined(__BUILTIN_VA_ARG_INCR) || defined(sparc) || defined(__sparc) || \ < defined(i386) || defined(__i386)) && !(defined(lint) || defined(__lint)) < < #define va_start(list, name) (void) (list = (va_list) &__builtin_va_alist) < #define va_arg(list, mode) ((mode *)__builtin_va_arg_incr((mode *)list))[0] < --- > #if defined(__ppc) > typedef struct { > unsigned long vararg_usage_info; > unsigned long *overflow_area; > unsigned long *arg_save_area; > } va_list[1]; 55,76d40 < < #if __STDC__ != 0 /* -Xc compilation */ < #define va_start(list, name) (void) (list = (void *)((char *)&name + \ < ((sizeof (name) + (sizeof (int) - 1)) & ~(sizeof (int) - 1)))) < #else < #define va_start(list, name) (void) (list = (void *)((char *)&...)) < #endif /* __STDC__ != 0 */ < #define va_arg(list, mode) \ < ((mode *)(list = (void *)((char *)list + sizeof (mode))))[-1] < < #endif /* (defined(__BUILTIN_VA_ARG_INCR) || ... */ < < extern void va_end(va_list); < #define va_end(list) (void)0 < < #else /* ! __STDC__ */ < < /* < * In the absence of __STDC__, this file provides traditional varargs < * semantics. < */ < 77a42 > #endif 84a50,54 > #if defined(__ppc) > extern void __builtin_va_info(va_list); > /*** the __va_start() is a work-around for a compiler bug ***/ > #define va_start(list) __builtin_va_info(list); __va_start(list); > #else 85a56 > #endif 89a61,64 > #if defined(__ppc) > extern void *__va_arg(va_list, int); > #define va_arg(list, mode) ((mode *)__va_arg(list, __va_INFO((mode *) 0)))[0] > #else 90a66 > #endif /*__ppc*/ 95c71,94 < #endif /* __STDC__ */ --- > #if defined(__ppc) > /* extra macros and functions for PowerPC */ > /* __va_copy is a necessary architecture dependent extension */ > #define __va_copy(to, from) (to[0] = from[0]) > > /* these library functions have been added for execl() */ > void ** __va_list_to_vec(va_list arglist); > void __va_vec_free(void **argvec); > #endif > > #if defined(__ppc) > /* extra macros and functions for PowerPC */ > /* __va_copy is a necessary architecture dependent extension */ > #define __va_copy(to, from) (to[0] = from[0]) > > /* these library functions have been added for execl() */ > #if defined(__STDC__) > void **__va_list_to_vec(va_list); > void __va_vec_free(void **); > #else > void **__va_list_to_vec(); > void __va_vec_free(); > #endif > #endif /*__ppc*/