4 * arch/i386/include/arch.h
10 #define MM_USER_MIN 0x00200000
11 #define USER_STACK_SZ 0x00010000
12 #define USER_STACK_TOP 0x00800000
13 #define MM_USER_MAX 0xBC000000
14 #define MM_PPD_MIN 0xBC000000 // Per-Process Data
15 #define MM_PPD_VFS 0xBC000000 //
16 #define MM_PPD_CFG 0xBFFFF000 //
17 #define MM_PPD_MAX 0xB0000000
18 #define KERNEL_BASE 0xC0000000
19 #define MM_KHEAP_BASE 0xC0400000 // C+4MiB
20 #define MM_KHEAP_MAX 0xCF000000 //
21 #define MM_KERNEL_VFS 0xCF000000 //
22 #define MM_KUSER_CODE 0xCFFF0000 // 16 Pages
23 #define MM_MODULE_MIN 0xD0000000 // Lowest Module Address
24 #define MM_MODULE_MAX 0xF0000000 // 512 MiB
28 // - Processor/Machine Specific Features
30 // Uses no advanced features
38 # error "Unknown architecture '" #ARCH "'"
54 typedef volatile int tSpinlock;
55 #define LOCK(lockptr) do {int v=1;\
56 while(v)__asm__ __volatile__("lock xchgl %%eax, (%%edi)":"=a"(v):"a"(1),"D"(lockptr));}while(0)
57 #define RELEASE(lockptr) __asm__ __volatile__("lock andl $0, (%%edi)"::"D"(lockptr));
58 #define HALT() __asm__ __volatile__ ("hlt")
61 typedef unsigned int Uint; // Unsigned machine native integer
62 typedef unsigned char Uint8;
63 typedef unsigned short Uint16;
64 typedef unsigned long Uint32;
65 typedef unsigned long long Uint64;
66 typedef signed int Sint; // Signed Machine Native integer
67 typedef signed char Sint8;
68 typedef signed short Sint16;
69 typedef signed long Sint32;
70 typedef signed long long Sint64;
74 typedef Uint64 tPAddr;
76 typedef Uint32 tPAddr;
78 typedef Uint32 tVAddr;
82 Uint edi, esi, ebp, kesp;
83 Uint ebx, edx, ecx, eax;
84 Uint int_num, err_code;
90 Uint Resvd1[4]; // GS, FS, ES, DS
91 Uint Arg4, Arg5; // EDI, ESI
93 Uint Resvd2[1]; // Kernel ESP
100 Uint RetHi; // High 32 bits of ret
107 Uint Resvd3[5]; // Int, Err, Eip, CS, ...
108 Uint StackPointer; // ESP
109 Uint Resvd4[1]; // SS
120 } __attribute__ ((packed));
122 } __attribute__ ((packed)) tGDT;
136 #endif // !defined(_ARCH_H_)