OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [include/] [l4/] [glue/] [arm/] [syscall.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * ARM-specific system call details.
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
 
7
#ifndef __ARM_GLUE_SYSCALL_H__
8
#define __ARM_GLUE_SYSCALL_H__
9
 
10
#include <l4/types.h>
11
#include INC_GLUE(message.h)
12
 
13
/* Only specific call is the trap that gives back the kip address
14
 * from which other system calls can be discovered. */
15
#define L4_TRAP_KIP                     0xB4
16
 
17
/* Used in the kernel to refer to virtual address of this page.
18
 * User space discovers it from the KIP */
19
#define ARM_SYSCALL_PAGE                0xFFFFF000
20
 
21
extern unsigned int __syscall_page_start;
22
 
23
/*
24
 * This structure is saved on the kernel stack
25
 * just after entering a system call exception.
26
 */
27
typedef struct syscall_context {
28
        u32 spsr;
29
        u32 r0;
30
        u32 r1;
31
        u32 r2;
32
        u32 r3;         /* MR0 */
33
        u32 r4;         /* MR1 */
34
        u32 r5;         /* MR2 */
35
        u32 r6;         /* MR3 */
36
        u32 r7;         /* MR4 */
37
        u32 r8;         /* MR5 */
38
        u32 r9;
39
        u32 r10;
40
        u32 r11;
41
        u32 r12;
42
        u32 sp_usr;
43
        u32 lr_usr;
44
} __attribute__((__packed__)) syscall_context_t;
45
 
46
typedef struct msg_regs {
47
        u32 mr0;
48
        u32 mr1;
49
        u32 mr2;
50
        u32 mr3;
51
        u32 mr4;
52
        u32 mr5;
53
} msg_regs_t;
54
 
55
/* NOTE:
56
 * These references are valid only when they have been explicitly set
57
 * by a kernel entry point, e.g. a system call, a data abort handler
58
 * that imitates a page fault ipc etc.
59
 *
60
 * Second note:
61
 * _If_ these refer to real utcb's in the future, make sure to have
62
 * utcb_map_lazily() check so that they're safe accesses.
63
 */
64
#define KTCB_REF_ARG0(ktcb)     (&(ktcb)->syscall_regs->r0)
65
#define KTCB_REF_MR0(ktcb)      (&(ktcb)->syscall_regs->MR0_REGISTER)
66
 
67
/* Represents each syscall. We get argument registers
68
 * from stack for now. This is slower but the simplest. */
69
typedef int (*syscall_fn_t)(struct syscall_context *regs);
70
 
71
/* Entry point for syscall dispatching. Called from asm */
72
int syscall(struct syscall_context *regs, unsigned long);
73
 
74
/* Syscall-related initialiser called during system init. */
75
void syscall_init(void);
76
void kip_init_syscalls(void);
77
 
78
#endif /* __ARM_GLUE_SYSCALL_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.