4 * arch/i386/include/arch.h
10 #define KERNEL_BASE 0xC0000000
13 // - Processor/Machine Specific Features
14 #if ARCH != i386 && ARCH != i486 && ARCH != i586
15 # error "Unknown architecture '" #ARCH "'"
31 typedef volatile int tSpinlock;
32 #define IS_LOCKED(lockptr) (!!(*(tSpinlock*)lockptr))
33 #define LOCK(lockptr) do {int v=1;\
34 while(v)__asm__ __volatile__("lock xchgl %%eax, (%%edi)":"=a"(v):"a"(1),"D"(lockptr));}while(0)
35 #define RELEASE(lockptr) __asm__ __volatile__("lock andl $0, (%%edi)"::"D"(lockptr));
36 #define HALT() __asm__ __volatile__ ("hlt")
39 typedef unsigned int Uint; // Unsigned machine native integer
40 typedef unsigned char Uint8;
41 typedef unsigned short Uint16;
42 typedef unsigned long Uint32;
43 typedef unsigned long long Uint64;
44 typedef signed int Sint; // Signed Machine Native integer
45 typedef signed char Sint8;
46 typedef signed short Sint16;
47 typedef signed long Sint32;
48 typedef signed long long Sint64;
51 typedef Uint64 tPAddr;
52 typedef Uint32 tVAddr;
56 Uint edi, esi, ebp, kesp;
57 Uint ebx, edx, ecx, eax;
58 Uint int_num, err_code;
64 Uint Resvd1[4]; // GS, FS, ES, DS
65 Uint Arg4, Arg5; // EDI, ESI
67 Uint Resvd2[1]; // Kernel ESP
74 Uint RetHi; // High 32 bits of ret
81 Uint Resvd3[5]; // Int, Err, Eip, CS, ...
82 Uint StackPointer; // ESP
98 #endif // !defined(_ARCH_H_)