mirror of
https://github.com/drasko/codezero.git
synced 2026-04-24 20:59:05 +02:00
Added a new irq_control system call
This is currently an empty call. It will be used for registering, receiving and releasing irqs.
This commit is contained in:
@@ -58,9 +58,9 @@ typedef int (*__l4_thread_control_t)(unsigned int action, struct task_ids *ids);
|
|||||||
extern __l4_thread_control_t __l4_thread_control;
|
extern __l4_thread_control_t __l4_thread_control;
|
||||||
int l4_thread_control(unsigned int action, struct task_ids *ids);
|
int l4_thread_control(unsigned int action, struct task_ids *ids);
|
||||||
|
|
||||||
typedef int (*__l4_space_control_t)(unsigned int action, void *kdata);
|
typedef int (*__l4_irq_control_t)(unsigned int req, unsigned int flags, l4id_t id);
|
||||||
extern __l4_space_control_t __l4_space_control;
|
extern __l4_irq_control_t __l4_irq_control;
|
||||||
int l4_space_control(unsigned int action, void *kdata);
|
int l4_irq_control(unsigned int req, unsigned int flags, l4id_t id);
|
||||||
|
|
||||||
typedef int (*__l4_ipc_control_t)(unsigned int action, l4id_t blocked_sender,
|
typedef int (*__l4_ipc_control_t)(unsigned int action, l4id_t blocked_sender,
|
||||||
u32 blocked_tag);
|
u32 blocked_tag);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ struct l4lib_global_list {
|
|||||||
|
|
||||||
struct l4lib_tcb *l4lib_find_task(int tid);
|
struct l4lib_tcb *l4lib_find_task(int tid);
|
||||||
struct l4lib_tcb *l4_tcb_alloc_init(struct l4lib_tcb *parent, unsigned int flags);
|
struct l4lib_tcb *l4_tcb_alloc_init(struct l4lib_tcb *parent, unsigned int flags);
|
||||||
void l4lib_l4lib_global_add_task(struct l4lib_tcb *task);
|
void l4lib_global_add_task(struct l4lib_tcb *task);
|
||||||
void l4lib_global_remove_task(struct l4lib_tcb *task);
|
void l4lib_global_remove_task(struct l4lib_tcb *task);
|
||||||
|
|
||||||
#endif /* __LIB_TCB_H__ */
|
#endif /* __LIB_TCB_H__ */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Userspace system call interface.
|
* Userspace system call interface.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007 Bahadir Balban
|
* Copyright (C) 2007 - 2009 Bahadir Balban
|
||||||
*/
|
*/
|
||||||
#include <l4lib/arch/asm.h>
|
#include <l4lib/arch/asm.h>
|
||||||
#include <l4lib/arch/utcb.h>
|
#include <l4lib/arch/utcb.h>
|
||||||
@@ -186,15 +186,15 @@ END_PROC(l4_ipc_control)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Manipulates address spaces, e.g. sets up shared memory areas between threads
|
* Manipulates address spaces, e.g. sets up shared memory areas between threads
|
||||||
* @r0 = operation code, @r1 = struct shm_kdata *kdata
|
* @r0 = operation code, @r1 = operation flags, @r2 = An id (irqnum, or capid)
|
||||||
*/
|
*/
|
||||||
BEGIN_PROC(l4_space_control)
|
BEGIN_PROC(l4_irq_control)
|
||||||
stmfd sp!, {lr}
|
stmfd sp!, {lr}
|
||||||
ldr r12, =__l4_space_control
|
ldr r12, =__l4_irq_control
|
||||||
mov lr, pc
|
mov lr, pc
|
||||||
ldr pc, [r12]
|
ldr pc, [r12]
|
||||||
ldmfd sp!, {pc} @ Restore original lr and return.
|
ldmfd sp!, {pc} @ Restore original lr and return.
|
||||||
END_PROC(l4_space_control)
|
END_PROC(l4_irq_control)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Locks/unlocks a userspace mutex.
|
* Locks/unlocks a userspace mutex.
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ __l4_getid_t __l4_getid = 0;
|
|||||||
__l4_thread_switch_t __l4_thread_switch = 0;
|
__l4_thread_switch_t __l4_thread_switch = 0;
|
||||||
__l4_thread_control_t __l4_thread_control = 0;
|
__l4_thread_control_t __l4_thread_control = 0;
|
||||||
__l4_ipc_control_t __l4_ipc_control = 0;
|
__l4_ipc_control_t __l4_ipc_control = 0;
|
||||||
__l4_space_control_t __l4_space_control = 0;
|
__l4_irq_control_t __l4_irq_control = 0;
|
||||||
__l4_exchange_registers_t __l4_exchange_registers = 0;
|
__l4_exchange_registers_t __l4_exchange_registers = 0;
|
||||||
__l4_container_control_t __l4_container_control = 0;
|
__l4_container_control_t __l4_container_control = 0;
|
||||||
__l4_capability_control_t __l4_capability_control = 0;
|
__l4_capability_control_t __l4_capability_control = 0;
|
||||||
@@ -51,7 +51,7 @@ void __l4_init(void)
|
|||||||
__l4_thread_switch = (__l4_thread_switch_t)kip->thread_switch;
|
__l4_thread_switch = (__l4_thread_switch_t)kip->thread_switch;
|
||||||
__l4_thread_control= (__l4_thread_control_t)kip->thread_control;
|
__l4_thread_control= (__l4_thread_control_t)kip->thread_control;
|
||||||
__l4_ipc_control= (__l4_ipc_control_t)kip->ipc_control;
|
__l4_ipc_control= (__l4_ipc_control_t)kip->ipc_control;
|
||||||
__l4_space_control= (__l4_space_control_t)kip->space_control;
|
__l4_irq_control= (__l4_irq_control_t)kip->irq_control;
|
||||||
__l4_exchange_registers =
|
__l4_exchange_registers =
|
||||||
(__l4_exchange_registers_t)kip->exchange_registers;
|
(__l4_exchange_registers_t)kip->exchange_registers;
|
||||||
__l4_capability_control =
|
__l4_capability_control =
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ int l4_thread_create(struct task_ids *ids, unsigned int flags,
|
|||||||
|
|
||||||
/* Add child to the global task list */
|
/* Add child to the global task list */
|
||||||
child->tid = ids->tid;
|
child->tid = ids->tid;
|
||||||
global_add_task(child);
|
l4lib_global_add_task(child);
|
||||||
|
|
||||||
/* Start the new thread */
|
/* Start the new thread */
|
||||||
if ((err = l4_thread_control(THREAD_RUN, ids)) < 0) {
|
if ((err = l4_thread_control(THREAD_RUN, ids)) < 0) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef __MM0_CONTAINER_H__
|
#ifndef __MM0_CONTAINER_H__
|
||||||
#define __MM0_CONTAINER_H__
|
#define __MM0_CONTAINER_H__
|
||||||
|
|
||||||
|
#define __PAGERNAME__ "mm0"
|
||||||
|
|
||||||
#define SHMEM_REGION_START %(shmem_start)s
|
#define SHMEM_REGION_START %(shmem_start)s
|
||||||
#define SHMEM_REGION_END %(shmem_end)s
|
#define SHMEM_REGION_END %(shmem_end)s
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define CODEZERO_VERSION 0
|
#define CODEZERO_VERSION 0
|
||||||
#define CODEZERO_SUBVERSION 1
|
#define CODEZERO_SUBVERSION 2
|
||||||
#define KDESC_DATE_SIZE 12
|
#define KDESC_DATE_SIZE 12
|
||||||
#define KDESC_TIME_SIZE 9
|
#define KDESC_TIME_SIZE 9
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ struct kip {
|
|||||||
u32 container_control;
|
u32 container_control;
|
||||||
u32 time;
|
u32 time;
|
||||||
|
|
||||||
u32 space_control;
|
u32 irq_control;
|
||||||
u32 thread_control;
|
u32 thread_control;
|
||||||
u32 ipc_control;
|
u32 ipc_control;
|
||||||
u32 map;
|
u32 map;
|
||||||
@@ -71,9 +71,6 @@ struct kip {
|
|||||||
struct kernel_descriptor kdesc;
|
struct kernel_descriptor kdesc;
|
||||||
} __attribute__((__packed__));
|
} __attribute__((__packed__));
|
||||||
|
|
||||||
#define __PAGERNAME__ "mm0"
|
|
||||||
#define __VFSNAME__ "fs0"
|
|
||||||
#define __BLKDEVNAME__ "blkdev0"
|
|
||||||
|
|
||||||
#if defined (__KERNEL__)
|
#if defined (__KERNEL__)
|
||||||
extern struct kip kip;
|
extern struct kip kip;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#define sys_exchange_registers_offset 0xC
|
#define sys_exchange_registers_offset 0xC
|
||||||
#define sys_schedule_offset 0x10
|
#define sys_schedule_offset 0x10
|
||||||
#define sys_unmap_offset 0x14
|
#define sys_unmap_offset 0x14
|
||||||
#define sys_space_control_offset 0x18
|
#define sys_irq_control_offset 0x18
|
||||||
#define sys_ipc_control_offset 0x1C
|
#define sys_ipc_control_offset 0x1C
|
||||||
#define sys_map_offset 0x20
|
#define sys_map_offset 0x20
|
||||||
#define sys_getid_offset 0x24
|
#define sys_getid_offset 0x24
|
||||||
@@ -37,7 +37,7 @@ int sys_thread_control(unsigned int flags, struct task_ids *ids);
|
|||||||
int sys_exchange_registers(struct exregs_data *exregs, l4id_t tid);
|
int sys_exchange_registers(struct exregs_data *exregs, l4id_t tid);
|
||||||
int sys_schedule(void);
|
int sys_schedule(void);
|
||||||
int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid);
|
int sys_unmap(unsigned long virtual, unsigned long npages, unsigned int tid);
|
||||||
int sys_space_control(void);
|
int sys_irq_control(unsigned int req, unsigned int flags, l4id_t id);
|
||||||
int sys_ipc_control(void);
|
int sys_ipc_control(void);
|
||||||
int sys_map(unsigned long phys, unsigned long virt, unsigned long npages,
|
int sys_map(unsigned long phys, unsigned long virt, unsigned long npages,
|
||||||
unsigned int flags, l4id_t tid);
|
unsigned int flags, l4id_t tid);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Import('env')
|
|||||||
Import('symbols')
|
Import('symbols')
|
||||||
|
|
||||||
# The set of source files associated with this SConscript file.
|
# The set of source files associated with this SConscript file.
|
||||||
src_local = ['kip.c', 'syscall.c', 'thread.c', 'ipc.c', 'map.c', 'mutex.c', 'cap.c', 'exregs.c']
|
src_local = ['kip.c', 'syscall.c', 'thread.c', 'ipc.c', 'map.c', 'mutex.c', 'cap.c', 'exregs.c', 'irq.c']
|
||||||
|
|
||||||
obj = env.Object(src_local)
|
obj = env.Object(src_local)
|
||||||
|
|
||||||
|
|||||||
@@ -36,11 +36,6 @@ int sys_schedule(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sys_space_control(void)
|
|
||||||
{
|
|
||||||
return -ENOSYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
int sys_getid(struct task_ids *ids)
|
int sys_getid(struct task_ids *ids)
|
||||||
{
|
{
|
||||||
struct ktcb *this = current;
|
struct ktcb *this = current;
|
||||||
|
|||||||
@@ -849,7 +849,7 @@ int process_cap_info(struct cap_info *cap,
|
|||||||
&kres->virtmem_free,
|
&kres->virtmem_free,
|
||||||
cap->start, cap->end);
|
cap->start, cap->end);
|
||||||
} else if (cap_type(cap) == CAP_TYPE_MAP_PHYSMEM) {
|
} else if (cap_type(cap) == CAP_TYPE_MAP_PHYSMEM) {
|
||||||
if (cap_is_devmem(cap))
|
if (!cap_is_devmem(cap))
|
||||||
memcap_unmap(&kres->physmem_used,
|
memcap_unmap(&kres->physmem_used,
|
||||||
&kres->physmem_free,
|
&kres->physmem_free,
|
||||||
cap->start, cap->end);
|
cap->start, cap->end);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
void kip_init_syscalls(void)
|
void kip_init_syscalls(void)
|
||||||
{
|
{
|
||||||
kip.space_control = ARM_SYSCALL_PAGE + sys_space_control_offset;
|
kip.irq_control = ARM_SYSCALL_PAGE + sys_irq_control_offset;
|
||||||
kip.thread_control = ARM_SYSCALL_PAGE + sys_thread_control_offset;
|
kip.thread_control = ARM_SYSCALL_PAGE + sys_thread_control_offset;
|
||||||
kip.ipc_control = ARM_SYSCALL_PAGE + sys_ipc_control_offset;
|
kip.ipc_control = ARM_SYSCALL_PAGE + sys_ipc_control_offset;
|
||||||
kip.map = ARM_SYSCALL_PAGE + sys_map_offset;
|
kip.map = ARM_SYSCALL_PAGE + sys_map_offset;
|
||||||
@@ -76,9 +76,11 @@ int arch_sys_unmap(syscall_context_t *regs)
|
|||||||
(unsigned int)regs->r2);
|
(unsigned int)regs->r2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int arch_sys_space_control(syscall_context_t *regs)
|
int arch_sys_irq_control(syscall_context_t *regs)
|
||||||
{
|
{
|
||||||
return sys_space_control();
|
return sys_irq_control((unsigned int)regs->r0,
|
||||||
|
(unsigned int)regs->r1,
|
||||||
|
(l4id_t)regs->r2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int arch_sys_ipc_control(syscall_context_t *regs)
|
int arch_sys_ipc_control(syscall_context_t *regs)
|
||||||
@@ -133,7 +135,7 @@ void syscall_init()
|
|||||||
syscall_table[sys_schedule_offset >> 2] = (syscall_fn_t)arch_sys_schedule;
|
syscall_table[sys_schedule_offset >> 2] = (syscall_fn_t)arch_sys_schedule;
|
||||||
syscall_table[sys_getid_offset >> 2] = (syscall_fn_t)arch_sys_getid;
|
syscall_table[sys_getid_offset >> 2] = (syscall_fn_t)arch_sys_getid;
|
||||||
syscall_table[sys_unmap_offset >> 2] = (syscall_fn_t)arch_sys_unmap;
|
syscall_table[sys_unmap_offset >> 2] = (syscall_fn_t)arch_sys_unmap;
|
||||||
syscall_table[sys_space_control_offset >> 2] = (syscall_fn_t)arch_sys_space_control;
|
syscall_table[sys_irq_control_offset >> 2] = (syscall_fn_t)arch_sys_irq_control;
|
||||||
syscall_table[sys_ipc_control_offset >> 2] = (syscall_fn_t)arch_sys_ipc_control;
|
syscall_table[sys_ipc_control_offset >> 2] = (syscall_fn_t)arch_sys_ipc_control;
|
||||||
syscall_table[sys_map_offset >> 2] = (syscall_fn_t)arch_sys_map;
|
syscall_table[sys_map_offset >> 2] = (syscall_fn_t)arch_sys_map;
|
||||||
syscall_table[sys_capability_control_offset >> 2] = (syscall_fn_t)arch_sys_capability_control;
|
syscall_table[sys_capability_control_offset >> 2] = (syscall_fn_t)arch_sys_capability_control;
|
||||||
|
|||||||
Reference in New Issue
Block a user