Towards finishing exchange_registers()

- Added mutex_trylock()
- Implemented most of exchange_registers()
- thread_control() now needs a lock for operations that can modify thread context.
- thread_start() does not initialise scheduler flags, now done in thread_create.

TODO:
- Fork/clone'ed threads should retain their context in tcb, not syscall stack.
- exchange_registers() calls in userspace need cleaning up.
This commit is contained in:
Bahadir Balban
2008-09-13 18:07:00 +03:00
parent 0b3ab05a98
commit 4fb5277123
23 changed files with 460 additions and 98 deletions

View File

@@ -2,12 +2,13 @@
* ARM-specific system call details.
*
* Copyright (C) 2007 Bahadir Balban
*
*/
#ifndef __ARM_GLUE_SYSCALL_H__
#define __ARM_GLUE_SYSCALL_H__
#include <l4/types.h>
/* Only specific call is the trap that gives back the kip address
* from which other system calls can be discovered. */
#define L4_TRAP_KIP 0xB4
@@ -52,7 +53,8 @@ typedef struct msg_regs {
/* NOTE:
* These references are valid only when they have been explicitly set
* by a kernel entry point, e.g. a system call, a data abort handler.
* by a kernel entry point, e.g. a system call, a data abort handler
* that imitates a page fault ipc etc.
*/
#define KTCB_REF_ARG0(ktcb) (&(ktcb)->syscall_regs->r0)
#define KTCB_REF_MR0(ktcb) (&(ktcb)->syscall_regs->r3)