List.mui: Update entries count prior to range change
[AROS.git] / arch / i386-all / include / aros / cpu.h
blob9ce346b8127d9732c486f0da7bc5c26d2253dfaa
1 #ifndef AROS_I386_CPU_H
2 #define AROS_I386_CPU_H
4 /*
5 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 $Id$
8 NOTE: This file must compile *without* any other header !
10 Desc: CPU-specific definitions for 32-bit x86 processors
11 Lang: english
14 /* Information about size and alignment,
15 * the defines have to be numeric constants */
16 #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
17 #define AROS_BIG_ENDIAN 0 /* Big or little endian */
18 #define AROS_SIZEOFULONG 4 /* Size of an ULONG */
19 #define AROS_SIZEOFPTR 4 /* Size of a PTR */
20 #define AROS_WORDALIGN 2 /* Alignment for WORD */
21 #define AROS_LONGALIGN 4 /* Alignment for LONG */
22 #define AROS_QUADALIGN 4 /* Alignment for QUAD */
23 #define AROS_PTRALIGN 4 /* Alignment for PTR */
24 #define AROS_IPTRALIGN 4 /* Alignment for IPTR */
25 #define AROS_DOUBLEALIGN 4 /* Alignment for double */
26 #define AROS_WORSTALIGN 16 /* Worst case alignment */
27 #define AROS_STACKALIGN 16 /* Clean stack must be aligned to this */
29 #define AROS_32BIT_TYPE int
31 /* Use C pointer and string for the BCPL pointers and strings
32 * For a normal ABI these should not be defined for maximum source code
33 * compatibility.
35 #define AROS_FAST_BPTR 1
36 #define AROS_FAST_BSTR 1
38 /* do we need a function attribute to get parameters on the stack? */
39 #define __stackparm
41 /* types and limits for sig_atomic_t */
42 #define AROS_SIG_ATOMIC_T int
43 #define AROS_SIG_ATOMIC_MIN (-0x7fffffff-1)
44 #define AROS_SIG_ATOMIC_MAX 0x7fffffff
46 #ifndef __TINYC__
47 #define AROS_GET_SP ({register unsigned char *sp asm("%esp"); sp;})
48 #endif
51 One entry in a library's jumptable. For assembler compatibility, the
52 field jmp should contain the code for an absolute jmp to a 32bit
53 address. There are also a couple of macros which you should use to
54 access the vector table from C.
56 struct FullJumpVec
58 unsigned char jmp;
59 void *vec;
60 } __attribute__((packed));
62 #define __AROS_SET_FULLJMP(v,a) \
63 do \
64 { \
65 struct FullJumpVec *_v = v; \
66 _v->jmp = 0xE9; \
67 _v->vec = (void *) ((ULONG)(a) - (ULONG)(_v) - 5);\
68 } while (0)
70 struct JumpVec
72 void *vec;
75 /* Use these to access a vector table */
76 #define LIB_VECTSIZE (sizeof (struct JumpVec))
77 #define __AROS_GETJUMPVEC(lib,n) (&((struct JumpVec *)lib)[-(n)])
78 #define __AROS_GETVECADDR(lib,n) (__AROS_GETJUMPVEC(lib,n)->vec)
79 #define __AROS_SETVECADDR(lib,n,addr) (__AROS_GETJUMPVEC(lib,n)->vec = (addr))
80 #define __AROS_INITVEC(lib,n) __AROS_SETVECADDR(lib,n,_aros_not_implemented)
83 We want to activate the execstubs and preserve all registers
84 when calling obtainsemaphore, obtainsemaphoreshared, releasesemaphore,
85 getcc, permit, forbid, enable, disable
87 #undef UseExecstubs
88 #define UseExecstubs 1
90 /* Macros to test/set failure of AllocEntry() */
91 #define AROS_ALLOCENTRY_FAILED(memType) \
92 ((struct MemList *)((IPTR)(memType) | 0x80ul<<(sizeof(APTR)-1)*8))
93 #define AROS_CHECK_ALLOCENTRY(memList) \
94 (!((IPTR)(memList) & 0x80ul<<(sizeof(APTR)-1)*8))
97 Find the next valid alignment for a structure if the next x bytes must
98 be skipped.
100 #define AROS_ALIGN(x) (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
102 /* Prototypes */
103 extern void _aros_not_implemented ();
104 extern void aros_not_implemented ();
107 How much stack do we need ? Lots :-) ?
108 Not so much, I think (schulz) ;-))
111 #define AROS_STACKSIZE 40960
113 /* Some defines to set the cpu specific libcall.h interface */
114 #define __AROS_LIBCALL_H_FILE "aros/i386/libcall.h"
116 #endif /* AROS_I386_CPU_H */