mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 00:10:39 +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="drivers">
|
||||||
<directory name="csq">
|
<directory name="csq">
|
||||||
<xi:include href="lib/drivers/csq/csq.rbuild" />
|
<xi:include href="lib/drivers/csq/csq.rbuild" />
|
||||||
/directory>
|
</directory>
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="debugsup">
|
<directory name="debugsup">
|
||||||
<xi:include href="lib/debugsup/debugsup.rbuild" />
|
<xi:include href="lib/debugsup/debugsup.rbuild" />
|
||||||
|
|
|
@ -42,16 +42,22 @@
|
||||||
|
|
||||||
NESTED_ENTRY KiSoftwareInterruptException
|
NESTED_ENTRY KiSoftwareInterruptException
|
||||||
PROLOG_END KiSoftwareInterruptException
|
PROLOG_END KiSoftwareInterruptException
|
||||||
|
|
||||||
//
|
//
|
||||||
// Save return address
|
// Save the current lr
|
||||||
//
|
//
|
||||||
str lr, [sp, #-4]!
|
str lr, [sp, #-4]!
|
||||||
|
|
||||||
|
//
|
||||||
|
// Save the SVC lr and sp
|
||||||
|
//
|
||||||
|
str lr, [sp, #-4]!
|
||||||
|
str sp, [sp, #-4]!
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make space for trap frame
|
// Make space for trap frame
|
||||||
//
|
//
|
||||||
sub sp, sp, #(4*17)
|
sub sp, sp, #(4*15)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Save user-mode registers
|
// Save user-mode registers
|
||||||
|
@ -77,7 +83,7 @@
|
||||||
//
|
//
|
||||||
mov r0, sp
|
mov r0, sp
|
||||||
bl KiSoftwareInterruptHandler
|
bl KiSoftwareInterruptHandler
|
||||||
|
|
||||||
//
|
//
|
||||||
// Skip IRQL
|
// Skip IRQL
|
||||||
//
|
//
|
||||||
|
@ -391,24 +397,65 @@ IntExit:
|
||||||
//
|
//
|
||||||
ldmia r5, {a1-a4}
|
ldmia r5, {a1-a4}
|
||||||
add r5, r5, #(4* 4)
|
add r5, r5, #(4* 4)
|
||||||
//sub r6, r6, #4
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Now copy the other arguments into our stack
|
|
||||||
//
|
//
|
||||||
CopyLoop:
|
// This code is complete shit.
|
||||||
cmp r6, #4
|
//
|
||||||
//strne sp, [r5], #4
|
//
|
||||||
//subne r6, r6, #1
|
|
||||||
bge .
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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
|
// Now do the system call
|
||||||
//
|
//
|
||||||
|
SysCall:
|
||||||
|
mov lr, pc
|
||||||
mov pc, r4
|
mov pc, r4
|
||||||
|
|
||||||
|
//
|
||||||
|
// Restore the stack
|
||||||
|
//
|
||||||
|
mov sp, r11
|
||||||
|
|
||||||
//
|
//
|
||||||
// Should not get here
|
// Get us back
|
||||||
//
|
//
|
||||||
b .
|
mov pc, r10
|
||||||
ENTRY_END KiSystemCall
|
ENTRY_END KiSystemCall
|
||||||
|
|
|
@ -476,6 +476,7 @@ KiSystemService(IN PKTHREAD Thread,
|
||||||
//
|
//
|
||||||
// Copy them into the kernel stack
|
// Copy them into the kernel stack
|
||||||
//
|
//
|
||||||
|
DPRINT1("Argument: %p\n", *Argument);
|
||||||
Arguments[i] = *Argument;
|
Arguments[i] = *Argument;
|
||||||
Argument++;
|
Argument++;
|
||||||
}
|
}
|
||||||
|
@ -501,17 +502,22 @@ KiSystemService(IN PKTHREAD Thread,
|
||||||
// We were called from the kernel
|
// We were called from the kernel
|
||||||
//
|
//
|
||||||
Argument = (PULONG)TrapFrame->SvcSp;
|
Argument = (PULONG)TrapFrame->SvcSp;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Bias for the values we saved
|
||||||
|
//
|
||||||
|
Argument += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Copy the rest
|
// Copy the rest
|
||||||
//
|
//
|
||||||
DPRINT1("Stack: %p\n", Argument);
|
|
||||||
for (i = 4; i < ArgumentCount; i++)
|
for (i = 4; i < ArgumentCount; i++)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Copy into kernel stack
|
// Copy into kernel stack
|
||||||
//
|
//
|
||||||
|
DPRINT1("Argument: %p\n", *Argument);
|
||||||
Arguments[i] = *Argument;
|
Arguments[i] = *Argument;
|
||||||
Argument++;
|
Argument++;
|
||||||
}
|
}
|
||||||
|
@ -521,6 +527,7 @@ KiSystemService(IN PKTHREAD Thread,
|
||||||
// Do the system call and save result in EAX
|
// Do the system call and save result in EAX
|
||||||
//
|
//
|
||||||
TrapFrame->R0 = KiSystemCall(SystemCall, Arguments, ArgumentCount);
|
TrapFrame->R0 = KiSystemCall(SystemCall, Arguments, ArgumentCount);
|
||||||
|
DPRINT1("Returned: %lx\n", TrapFrame->R0);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Reference in a new issue