Files
codezero/tasks/libl4/include/l4lib/arch-arm/syscalls.h
Bahadir Balban f29c18ec09 Fixed various errors with ipc message passing.
Previously we had changed the method of setting the ipc tag from l4_ipc() call
argument to being passed as a message register.

- This change was not reflected in l4_ipc() signature as it still had a 3rd argument,
  even though ignored.

- l4_set_sender and _set_tag had their arguments wrong way around.
- Previously 5 mrs were passed onto utcb instead of 6, relying on the fact that
  l4_ipc tag argument was being passed in r3 directly, this wasnt true anymore
  with new convention, but wasn't catered for.

TODO:
- MM0 shouldn't really allocate tids itself, but use ones supplied by C0.
- Sender tid shouldn't really passed by the sender task, but rather by C0. Otherwise
  security can be easily breached by user tasks pretending to be other tasks. This
  would also save us a message register.
2008-02-06 12:26:31 +00:00

84 lines
2.6 KiB
C

/*
* System call prototypes.
*
* Copyright (C) 2007 Bahadir Balban
*/
#ifndef __ARM_SYSCALLS_H__
#define __ARM_SYSCALLS_H__
#include <l4lib/arch/types.h>
#include <l4lib/arch/vregs.h>
#include <l4lib/arch/message.h>
#include <l4/generic/space.h>
#include <l4/api/space.h>
#include <l4/api/kip.h>
#include <l4/api/ipc.h>
#include <l4/api/thread.h>
static inline void *
l4_kernel_interface(unsigned int *api_version, unsigned int *api_flags,
unsigned int *kernel_id)
{
return (void *)L4_KIP_ADDRESS;
}
typedef unsigned int (*__l4_thread_switch_t)(u32);
extern __l4_thread_switch_t __l4_thread_switch;
unsigned int l4_thread_switch (u32 dest);
typedef int (*__l4_getid_t)(struct task_ids *ids);
extern __l4_getid_t __l4_getpid;
int l4_getid(struct task_ids *ids);
typedef int (*__l4_ipc_t)(l4id_t to, l4id_t from);
extern __l4_ipc_t __l4_ipc;
int l4_ipc(l4id_t to, l4id_t from);
typedef int (*__l4_kread_t)(u32 rd, void *addr);
extern __l4_kread_t __l4_kread;
int l4_kread(u32 rd, void *addr);
typedef int (*__l4_map_t)(void *phys, void *virt,
u32 npages, u32 flags, l4id_t tid);
extern __l4_map_t __l4_map;
int l4_map(void *p, void *v, u32 npages, u32 flags, l4id_t tid);
typedef int (*__l4_unmap_t)(void *virt, unsigned long npages, l4id_t tid);
extern __l4_unmap_t __l4_unmap;
int l4_unmap(void *virtual, unsigned long numpages, l4id_t tid);
typedef int (*__l4_thread_control_t)(unsigned int action, struct task_ids *ids);
extern __l4_thread_control_t __l4_thread_control;
int l4_thread_control(unsigned int action, struct task_ids *ids);
typedef int (*__l4_space_control_t)(unsigned int action, void *kdata);
extern __l4_space_control_t __l4_space_control;
int l4_space_control(unsigned int action, void *kdata);
typedef int (*__l4_ipc_control_t)(unsigned int action, l4id_t blocked_sender,
u32 blocked_tag);
extern __l4_ipc_control_t __l4_ipc_control;
int l4_ipc_control(unsigned int, l4id_t blocked_sender, u32 blocked_tag);
typedef int (*__l4_exchange_registers_t)(unsigned int pc, unsigned int sp,
l4id_t pager, l4id_t tid);
extern __l4_exchange_registers_t __l4_exchange_registers;
int l4_exchange_registers(unsigned int pc, unsigned int sp, int pager, l4id_t tid);
typedef int (*__l4_kmem_reclaim_t)(unsigned long *pfn, int *npages);
extern __l4_kmem_reclaim_t __l4_kmem_reclaim;
int l4_kmem_reclaim(unsigned long *pfn, int *npages);
typedef int (*__l4_kmem_grant_t)(unsigned long pfn, int npages);
extern __l4_kmem_grant_t __l4_kmem_grant;
int l4_kmem_grant(unsigned long pfn, int npages);
/* To be supplied by server tasks. */
void *virt_to_phys(void *);
void *phys_to_virt(void *);
#endif /* __ARM_SYSCALLS_H__ */