Changeset 2085 for Whitix/branches/netchannel/arch/i386/kernel/process.c
- Timestamp:
- 05/20/10 16:05:25 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/netchannel/arch/i386/kernel/process.c
r2084 r2085 33 33 void i386ExitThread(); 34 34 void endi386ExitThread(); 35 void i386RetFromEvent(); 36 void endi386RetFromEvent(); 37 35 38 DWORD exitCode=0xF8000000; 39 DWORD retFromEvent; 36 40 37 41 struct TSS* tss=(struct TSS*)(TSS_ADDR); … … 56 60 int ThrArchInit() 57 61 { 62 int exitCodeSz = (DWORD)endi386ExitThread-(DWORD)i386ExitThread; 63 int retEventSz = (DWORD)endi386RetFromEvent - (DWORD)i386RetFromEvent; 64 58 65 /* Setup up the TSS, only needed for ss0 and esp0 */ 59 66 tss->bitmap=0x8000; /* Bitmap offset. Past limit, so every IO instruction in userspace will produce a GPF. */ … … 64 71 /* Copy the exit code over to a user accessable page of memory. Add procesor-specific syscall method code into the page soon. */ 65 72 VirtMemMapPage(0xF8000000, PageAlloc()->physAddr, PAGE_PRESENT | PAGE_RW | PAGE_USER); 66 memcpy((void*)exitCode, i386ExitThread, (DWORD)endi386ExitThread-(DWORD)i386ExitThread); 73 memcpy((void*)exitCode, i386ExitThread, exitCodeSz); 74 memcpy((void*)(exitCode + exitCodeSz), i386RetFromEvent, retEventSz); 75 76 retFromEvent = (DWORD)(exitCode + exitCodeSz); 67 77 68 78 return 0; … … 85 95 86 96 ret->esp3=*stackP; /* User stack */ 97 ret->eventStack = MMapDo(ret->parent, NULL, 0, 0x1000, PAGE_RW | PAGE_PRESENT | PAGE_USER, 0, MMAP_PRIVATE, NULL)+0x1000; 87 98 88 99 IrqSaveFlags(flags);
