1 #ifndef AROS_I386_CPU_H
2 #define AROS_I386_CPU_H
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
8 NOTE: This file must compile *without* any other header !
10 Desc: CPU-specific definitions for 32-bit x86 processors
14 typedef unsigned char cpuid_t
;
15 typedef unsigned char apicid_t
;
16 typedef void *cpumask_t
;
18 /* Information about size and alignment,
19 * the defines have to be numeric constants */
20 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
21 #define AROS_BIG_ENDIAN 0 /* Big or little endian */
22 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
23 #define AROS_SIZEOFPTR 4 /* Size of a PTR */
24 #define AROS_WORDALIGN 2 /* Alignment for WORD */
25 #define AROS_LONGALIGN 4 /* Alignment for LONG */
26 #define AROS_QUADALIGN 4 /* Alignment for QUAD */
27 #define AROS_PTRALIGN 4 /* Alignment for PTR */
28 #define AROS_IPTRALIGN 4 /* Alignment for IPTR */
29 #define AROS_DOUBLEALIGN 4 /* Alignment for double */
30 #define AROS_WORSTALIGN 16 /* Worst case alignment */
31 #define AROS_STACKALIGN 16 /* Clean stack must be aligned to this */
33 #define AROS_32BIT_TYPE int
35 /* Use C pointer and string for the BCPL pointers and strings
36 * For a normal ABI these should not be defined for maximum source code
39 #define AROS_FAST_BPTR 1
40 #define AROS_FAST_BSTR 1
42 /* do we need a function attribute to get parameters on the stack? */
45 /* types and limits for sig_atomic_t */
46 #define AROS_SIG_ATOMIC_T int
47 #define AROS_SIG_ATOMIC_MIN (-0x7fffffff-1)
48 #define AROS_SIG_ATOMIC_MAX 0x7fffffff
51 #define AROS_GET_SP ({register unsigned char *sp asm("%esp"); sp;})
55 One entry in a library's jumptable. For assembler compatibility, the
56 field jmp should contain the code for an absolute jmp to a 32bit
57 address. There are also a couple of macros which you should use to
58 access the vector table from C.
64 } __attribute__((packed
));
66 #define __AROS_SET_FULLJMP(v,a) \
69 struct FullJumpVec *_v = v; \
71 _v->vec = (void *) ((ULONG)(a) - (ULONG)(_v) - 5);\
79 /* Use these to access a vector table */
80 #define LIB_VECTSIZE (sizeof (struct JumpVec))
81 #define __AROS_GETJUMPVEC(lib,n) (&((struct JumpVec *)lib)[-(n)])
82 #define __AROS_GETVECADDR(lib,n) (__AROS_GETJUMPVEC(lib,n)->vec)
83 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_GETJUMPVEC(lib,n)->vec = (addr))
84 #define __AROS_INITVEC(lib,n) __AROS_SETVECADDR(lib,n,_aros_not_implemented)
87 We want to activate the execstubs and preserve all registers
88 when calling obtainsemaphore, obtainsemaphoreshared, releasesemaphore,
89 getcc, permit, forbid, enable, disable
92 #define UseExecstubs 1
94 /* Macros to test/set failure of AllocEntry() */
95 #define AROS_ALLOCENTRY_FAILED(memType) \
96 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
97 #define AROS_CHECK_ALLOCENTRY(memList) \
98 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
101 Find the next valid alignment for a structure if the next x bytes must
104 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
107 extern void _aros_not_implemented ();
108 extern void aros_not_implemented ();
111 How much stack do we need ? Lots :-) ?
112 Not so much, I think (schulz) ;-))
115 #define AROS_STACKSIZE 40960
117 /* Some defines to set the cpu specific libcall.h interface */
118 #define __AROS_LIBCALL_H_FILE "aros/i386/libcall.h"
120 #endif /* AROS_I386_CPU_H */