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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [uos/] [uos.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 222 markom
/* This file is part of test microkernel for OpenRISC 1000. */
2
/* (C) 2000 Damjan Lampret, lampret@opencores.org */
3
 
4
/* Length of the IPC message's useful data. */
5
#define MAX_MSGLEN 100
6
 
7
/* Number of user tasks in the system. */
8
#define MAX_TASKS 8
9
 
10
/* Number of IPC messages in the system. */
11
#define MAX_MSGS 16
12
 
13
/* Number of general purpose registers (not counting r0 and r1). */
14
#define GPRS 30
15
 
16
/* Size of kernel and user task stacks. Size for individual task. */
17
#define STACK_SIZE 2048 
18
 
19
/* Define this if you want kernel debug output. Note that you must
20
   assemble except_or32.S with KERNEL_OUTPUT defined in Makefile. This
21
   definition is only for main uos.c. */
22
#define KERNEL_OUTPUT 0
23
 
24
/* Define this if you want task switch at every system call. */
25
#define KERNEL_SYSCALL_SCHED 0
26
 
27
/* System tick timer period */
28
#define TICK_PERIOD 0x500
29
 
30
/* Task ID type (if we would have processes then we would call it PID) */
31
typedef int tid_t;
32
 
33
/* System call numbers */
34
#define IPC_MSGSND 1
35
#define IPC_MSGRCV 2
36
 
37
/* Message Control Block structure */
38
struct mcb {
39
        char msg[MAX_MSGLEN];           /* Message's data */
40
        int length;                     /* Message's length */
41
        tid_t origin;                   /* TID of message's origin task */
42
        struct mcb *next;               /* Next message in linked list */
43
};
44
 
45
/* Task Control Block structure */
46
struct tcb {
47
        struct regs {
48
                unsigned long pc;               /* Task's PC */
49
                unsigned long sp;               /* Task's stack (r1)*/
50
                unsigned long gprs[GPRS];       /* Task's GPRs r2-r15 */
51
                unsigned long sr;               /* Task's supervision register */
52
        } regs;
53
        struct mcb *waiting_msgs;       /* Waiting messages */
54
};
55
 
56
extern void dispatch();
57
/* Called by kernel_init to collect all tasks entries. */
58
extern void tasks_entries();

powered by: WebSVN 2.1.0

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