- Fix broken system call handler with shitty but works system call handler.

- Fix broken .rbuild file -- not sure how this was supposed to build in the first place.
- This gets us further -- more of ARM Mm needs implementing.


svn path=/trunk/; revision=34061
This commit is contained in:
ReactOS Portable Systems Group 2008-06-23 16:08:32 +00:00
parent bd7a8aac20
commit a179aed613
3 changed files with 69 additions and 15 deletions

View file

@ -80,7 +80,7 @@
<directory name="drivers">
<directory name="csq">
<xi:include href="lib/drivers/csq/csq.rbuild" />
/directory>
</directory>
</directory>
<directory name="debugsup">
<xi:include href="lib/debugsup/debugsup.rbuild" />

View file

@ -42,16 +42,22 @@
NESTED_ENTRY KiSoftwareInterruptException
PROLOG_END KiSoftwareInterruptException
//
// Save return address
// Save the current lr
//
str lr, [sp, #-4]!
//
// Save the SVC lr and sp
//
str lr, [sp, #-4]!
str sp, [sp, #-4]!
//
// Make space for trap frame
//
sub sp, sp, #(4*17)
sub sp, sp, #(4*15)
//
// Save user-mode registers
@ -77,7 +83,7 @@
//
mov r0, sp
bl KiSoftwareInterruptHandler
//
// Skip IRQL
//
@ -391,24 +397,65 @@ IntExit:
//
ldmia r5, {a1-a4}
add r5, r5, #(4* 4)
//sub r6, r6, #4
//
// Now copy the other arguments into our stack
//
CopyLoop:
cmp r6, #4
//strne sp, [r5], #4
//subne r6, r6, #1
bge .
// This code is complete shit.
//
//
//
// Save stack address and return address
//
mov r11, sp
mov r10, lr
//
// Check if we have more than 4 arguments
//
cmp r6, #4
ble SysCall
//
// Make space on stack
//
sub r6, r6, #4
sub sp, sp, r6, lsl #2
CopyLoop:
//
// Copy one parameter
//
ldr r7, [r5]
str r7, [sp]
add r5, r5, #4
add sp, sp, #4
//
// Keep looping until we've copied them all
//
cmp sp, r11
bne CopyLoop
//
// Set the stack
//
sub sp, sp, r6, lsl #2
//
// Now do the system call
//
SysCall:
mov lr, pc
mov pc, r4
//
// Restore the stack
//
mov sp, r11
//
// Should not get here
// Get us back
//
b .
mov pc, r10
ENTRY_END KiSystemCall

View file

@ -476,6 +476,7 @@ KiSystemService(IN PKTHREAD Thread,
//
// Copy them into the kernel stack
//
DPRINT1("Argument: %p\n", *Argument);
Arguments[i] = *Argument;
Argument++;
}
@ -501,17 +502,22 @@ KiSystemService(IN PKTHREAD Thread,
// We were called from the kernel
//
Argument = (PULONG)TrapFrame->SvcSp;
//
// Bias for the values we saved
//
Argument += 2;
}
//
// Copy the rest
//
DPRINT1("Stack: %p\n", Argument);
for (i = 4; i < ArgumentCount; i++)
{
//
// Copy into kernel stack
//
DPRINT1("Argument: %p\n", *Argument);
Arguments[i] = *Argument;
Argument++;
}
@ -521,6 +527,7 @@ KiSystemService(IN PKTHREAD Thread,
// Do the system call and save result in EAX
//
TrapFrame->R0 = KiSystemCall(SystemCall, Arguments, ArgumentCount);
DPRINT1("Returned: %lx\n", TrapFrame->R0);
}
VOID