Remove all references to ARM registers in system call arguments.

This commit is contained in:
Bahadir Balban
2009-06-10 17:30:02 +03:00
parent 6de090a365
commit 0dd8918ae5
10 changed files with 134 additions and 77 deletions

View File

@@ -149,7 +149,7 @@ int ipc_msg_copy(struct ktcb *to, struct ktcb *from)
return ret;
}
int sys_ipc_control(syscall_context_t *regs)
int sys_ipc_control(void)
{
return -ENOSYS;
}
@@ -540,11 +540,8 @@ void printk_sysregs(syscall_context_t *regs)
* - Can propagate messages from third party threads.
* - A thread can both send and receive on the same call.
*/
int sys_ipc(syscall_context_t *regs)
int sys_ipc(l4id_t to, l4id_t from, unsigned int flags)
{
l4id_t to = (l4id_t)regs->r0;
l4id_t from = (l4id_t)regs->r1;
unsigned int flags = (unsigned int)regs->r2;
unsigned int ipc_type = 0;
int ret = 0;

View File

@@ -56,15 +56,12 @@ 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_context *a)
int sys_kread(int rd, void *addr)
{
unsigned int *arg = KTCB_REF_ARG0(current);
void *addr = (void *)arg[1]; /* Buffer address */
int rd = (int)arg[0]; /* Request descriptor */
/* Error checking */
if (rd < 0)
return -EINVAL;
return __sys_kread(rd, addr);
}

View File

@@ -242,10 +242,8 @@ int mutex_control_unlock(unsigned long mutex_address)
return 0;
}
int sys_mutex_control(syscall_context_t *regs)
int sys_mutex_control(unsigned long mutex_address, int mutex_op)
{
unsigned long mutex_address = (unsigned long)regs->r0;
int mutex_op = (int)regs->r1;
unsigned long mutex_physical;
int ret = 0;

View File

@@ -16,13 +16,9 @@
* well. struct link new_mappings;
*/
int sys_map(syscall_context_t *regs)
int sys_map(unsigned long phys, unsigned long virt, unsigned long npages,
unsigned long flags, unsigned int tid)
{
unsigned long phys = regs->r0;
unsigned long virt = regs->r1;
unsigned long npages = regs->r2;
unsigned long flags = regs->r3;
unsigned int tid = regs->r4;
struct ktcb *target;
if (tid == current->tid) { /* The easiest case */
@@ -46,11 +42,8 @@ found:
* sucessfully, returns 0. If part of the range was found to be already
* unmapped, returns -1. This is may or may not be an error.
*/
int sys_unmap(syscall_context_t *regs)
int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid)
{
unsigned long virtual = regs->r0;
unsigned long npages = regs->r1;
unsigned int tid = regs->r2;
struct ktcb *target;
int ret = 0, retval = 0;

View File

@@ -98,12 +98,10 @@ void do_exchange_registers(struct ktcb *task, struct exregs_data *exregs)
* condition so that the scheduler does not execute it as we modify
* its context.
*/
int sys_exchange_registers(syscall_context_t *regs)
int sys_exchange_registers(struct exregs_data *exregs, l4id_t tid)
{
int err = 0;
struct ktcb *task;
struct exregs_data *exregs = (struct exregs_data *)regs->r0;
l4id_t tid = regs->r1;
/* Find tcb from its list */
if (!(task = tcb_find(tid)))
@@ -150,20 +148,19 @@ out:
return err;
}
int sys_schedule(syscall_context_t *regs)
int sys_schedule(void)
{
printk("(SVC) %s called. Tid (%d)\n", __FUNCTION__, current->tid);
return 0;
}
int sys_space_control(syscall_context_t *regs)
int sys_space_control(void)
{
return -ENOSYS;
}
int sys_getid(syscall_context_t *regs)
int sys_getid(struct task_ids *ids)
{
struct task_ids *ids = (struct task_ids *)regs->r0;
struct ktcb *this = current;
ids->tid = this->tid;
@@ -192,12 +189,8 @@ int validate_granted_pages(unsigned long pfn, int npages)
* this memory is used for thread creation and memory mapping, (e.g. new
* page tables, page middle directories, per-task kernel stack etc.)
*/
int sys_kmem_control(syscall_context_t *regs)
int sys_kmem_control(unsigned long pfn, int npages, int grant)
{
unsigned long pfn = (unsigned long)regs->r0;
int npages = (int)regs->r1;
int grant = (int)regs->r2;
/* Pager is granting us pages */
if (grant) {
/*

View File

@@ -15,7 +15,7 @@
#include INC_ARCH(asm.h)
#include INC_SUBARCH(mm.h)
int sys_thread_switch(syscall_context_t *regs)
int sys_thread_switch(void)
{
schedule();
return 0;
@@ -343,11 +343,9 @@ out_err:
* space for a thread that doesn't already have one, or destroys it if the last
* thread that uses it is destroyed.
*/
int sys_thread_control(syscall_context_t *regs)
int sys_thread_control(unsigned int flags, struct task_ids *ids)
{
int ret = 0;
unsigned int flags = regs->r0;
struct task_ids *ids = (struct task_ids *)regs->r1;
switch (flags & THREAD_ACTION_MASK) {
case THREAD_CREATE: