mirror of
https://github.com/drasko/codezero.git
synced 2026-01-29 03:03:13 +01:00
exchange_registers(), modified thread_control calls seem to work
- Fixed do_mmap() so that it returns mapped address, and various bugs. - A child seems to fork with new setup, but with incorrect return value. Need to use and test exregs() for fork + clone. - Shmat searches an unmapped area if input arg is invalid, do_mmap() should do this.
This commit is contained in:
@@ -75,16 +75,9 @@ static inline void irq_local_disable()
|
||||
/* This is filled on entry to irq handler, only if a process was interrupted.*/
|
||||
extern unsigned int preempted_psr;
|
||||
|
||||
#include <l4/generic/tcb.h>
|
||||
static inline int task_in_kernel(struct tcb *t)
|
||||
{
|
||||
return ((t->context.spsr & ARM_MODE_MASK) == ARM_MODE_SVC) ? 1 : 0;
|
||||
}
|
||||
|
||||
static inline int task_in_user(struct tcb *t)
|
||||
{
|
||||
return !task_in_kernel(t);
|
||||
}
|
||||
/* Implementing these as functions cause circular include dependency for tcb.h */
|
||||
#define TASK_IN_KERNEL(tcb) (((tcb)->context.spsr & ARM_MODE_MASK) == ARM_MODE_SVC)
|
||||
#define TASK_IN_USER(tcb) (!TASK_IN_KERNEL(tcb))
|
||||
|
||||
static inline int in_kernel()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user