Cleaned up all compile errors.

This commit is contained in:
Bahadir Balban
2008-08-25 16:59:00 +03:00
parent cdfaa4bbe9
commit 476bac5142
19 changed files with 99 additions and 80 deletions

View File

@@ -57,7 +57,7 @@ int __sys_kread(int rd, void *dest)
* support file positions, any such features aren't supported since this is call
* is discarded after startup.
*/
int sys_kread(struct syscall_args *a)
int sys_kread(struct syscall_context *a)
{
unsigned int *arg = KTCB_REF_ARG0(current);
void *addr = (void *)arg[1]; /* Buffer address */

View File

@@ -15,7 +15,7 @@
* well. struct list_head new_mappings;
*/
int sys_map(struct syscall_args *regs)
int sys_map(syscall_context_t *regs)
{
unsigned long phys = regs->r0;
unsigned long virt = regs->r1;
@@ -41,7 +41,7 @@ found:
}
int sys_unmap(struct syscall_args *regs)
int sys_unmap(syscall_context_t *regs)
{
unsigned long virt = regs->r0;
unsigned long npages = regs->r1;

View File

@@ -49,7 +49,7 @@ int sys_schedule(syscall_context_t *regs)
return 0;
}
int sys_space_control(struct syscall_args *regs)
int sys_space_control(syscall_context_t *regs)
{
return -ENOSYS;
}

View File

@@ -10,7 +10,8 @@
#include <l4/generic/tcb.h>
#include <l4/lib/idpool.h>
#include <l4/generic/pgalloc.h>
#include INC_ARCH(mm.h)
#include INC_ARCH(asm.h)
#include INC_SUBARCH(mm.h)
int sys_thread_switch(syscall_context_t *regs)
{
@@ -60,6 +61,8 @@ int thread_start(struct task_ids *ids)
return -EINVAL;
}
extern unsigned int return_from_syscall;
/*
* Copies the pre-syscall context of original thread into the kernel
* stack of new thread. Modifies new thread's context registers so that
@@ -75,15 +78,15 @@ int arch_setup_new_thread(struct ktcb *new, struct ktcb *orig)
* a system call exception. We need the location where it
* is saved relative to the start of ktcb.
*/
void *syscall_context_offset = (void *)orig->syscall_regs -
(void *)orig;
unsigned long syscall_context_offset =
((unsigned long)(orig->syscall_regs) - (unsigned long)orig);
/*
* Copy the saved context from original thread's
* stack to new thread stack.
*/
memcpy((void *)new + syscall_context_offset,
(void *)orig + syscall_context_offset,
memcpy((void *)((unsigned long)new + syscall_context_offset),
(void *)((unsigned long)orig + syscall_context_offset),
sizeof(syscall_context_t));
/*
@@ -98,8 +101,7 @@ int arch_setup_new_thread(struct ktcb *new, struct ktcb *orig)
* the new thread schedules, it executes the end part of the system
* call exception where the previous context is restored.
*/
new->context.sp = (unsigned long)((void *)new +
syscall_context_offset);
new->context.sp = (unsigned long)new + syscall_context_offset;
new->context.pc = (unsigned long)return_from_syscall;
/* Copy other relevant fields from original ktcb */
@@ -140,7 +142,7 @@ int thread_create(struct task_ids *ids, unsigned int flags)
goto out;
}
}
printk("Could not find given space, is ",
printk("Could not find given space, is "
"SAMESPC/COPYSPC the right flag?\n");
BUG();
}

View File

@@ -46,17 +46,16 @@ void fault_ipc_to_pager(u32 faulty_pc, u32 fsr, u32 far)
/*
* System calls save arguments (and message registers) on the kernel
* stack. They are then referenced from the caller's ktcb. Here, the
* same ktcb reference is set to the fault data so it gives the effect
* as if the ipc to the pager has the fault data in the message
* registers saved on the kernel stack during an ipc syscall. Also this
* way fault does not need to modify the actual utcb MRs in userspace.
* stack. They are then referenced from the caller's ktcb. Here, we
* forge a fault structure as if an ipc syscall has occured. Then
* the reference to the fault structure is set in the ktcb such that
* it lies on the mr0 offset when referred as the syscall context.
*/
/* Assign fault such that it overlaps as the MR0 reference in ktcb. */
current->syscall_regs = (syscall_args_t *)
current->syscall_regs = (syscall_context_t *)
((unsigned long)&mr[0] -
offsetof(syscall_args_t, r3));
offsetof(syscall_context_t, r3));
/* Send ipc to the task's pager */
ipc_sendrecv(current->pagerid, current->pagerid);

View File

@@ -365,12 +365,12 @@ void remove_mapping(unsigned long vaddr)
*/
pgd_table_t *copy_page_tables(pgd_table_t *from)
{
struct pmd_table_t *pmd, *orig;
struct pgd_table_t *pgd;
pmd_table_t *pmd, *orig;
pgd_table_t *pgd;
/* Allocate and copy pgd */
pgd = alloc_pgd();
memcpy(pgd, from, sizeof(struct pgd_table_t));
memcpy(pgd, from, sizeof(pgd_table_t));
/* Allocate and copy all valid pmds */
for (int i = 0; i < PGD_ENTRY_TOTAL; i++) {

View File

@@ -65,7 +65,7 @@ void update_system_time(void)
}
/* Read system time */
int sys_time(struct syscall_args *args)
int sys_time(syscall_context_t *args)
{
struct timeval *tv = (struct timeval *)args->r0;
int set = (int)args->r1;