rsp_ipc.h
1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* rsp_ipc.h
*
* Mon Mar 13 10:24:35 PST 1995
*
*
*/
/**************************************************************************
*
* $Revision: 1.1.1.2 $
* $Date: 2002/10/29 08:06:34 $
* $Source: /root/leakn64/depot/rf/sw/n64os20l/include/rsp_ipc.h,v $
*
**************************************************************************/
#ifndef _RSP_IPC_H_
#define _RSP_IPC_H_ 1
#if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
typedef enum
{
CMD_NULL,
CMD_CMD,
CMD_QUIT,
CMD_DMA_READ,
CMD_DMA_WRITE,
CMD_READ_WORD,
CMD_WRITE_WORD,
CMD_LAST
} rsp_shm_cmd_t;
typedef struct
{
unsigned long int dram[(2048 * 1024)>>2]; /* share DRAM */
/*
* howardc - Keep buff right after the dram to keep it 64b aligned. This
* is the fake DMA IPC buffer to communicate to rspsim. If 64b aligned, the
* _emAlign64b (64bit alignment checking code) will properly check for
* alignment.
*/
unsigned long int buff[1024]; /* could be IMEM or DMEM */
char string[256]; /* pass command string */
rsp_shm_cmd_t cmd; /* what to do */
int reg; /* which register */
unsigned long int addr; /* RSP memory address for copy */
unsigned long int length; /* length of data to be copied */
} rsp_shm_buf_t;
/*
* simple semaphore interface, stolen from Stevens' Networking book.
*
* Tue Feb 7 13:38:49 PST 1995
*
*/
extern int sem_create(key_t key, int initval);
extern int sem_open(key_t key);
extern int sem_rm(int id);
extern int sem_close(int id);
extern int sem_wait(int id);
extern int sem_signal(int id);
extern int sem_op(int id, int value);
#endif
#endif