mirror of
https://github.com/reactos/reactos.git
synced 2025-05-29 05:58:13 +00:00
- 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:
parent
bd7a8aac20
commit
a179aed613
3 changed files with 69 additions and 15 deletions
|
@ -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" />
|
||||
|
|
|
@ -44,14 +44,20 @@
|
|||
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
|
||||
|
@ -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:
|
||||
// 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
|
||||
//strne sp, [r5], #4
|
||||
//subne r6, r6, #1
|
||||
bge .
|
||||
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
|
||||
|
||||
//
|
||||
// Should not get here
|
||||
// Restore the stack
|
||||
//
|
||||
b .
|
||||
mov sp, r11
|
||||
|
||||
//
|
||||
// Get us back
|
||||
//
|
||||
mov pc, r10
|
||||
ENTRY_END KiSystemCall
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue