* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / include / asm-sparc / ap1000 / aplib.h
blob55e2f528dc423d342122c9917c0185a118d0569b
1 /*
2 * Copyright 1996 The Australian National University.
3 * Copyright 1996 Fujitsu Laboratories Limited
4 *
5 * This software may be distributed under the terms of the Gnu
6 * Public License version 2 or later
7 */
9 /* aplib kernel interface definition */
11 #ifndef _APLIB_H_
12 #define _APLIB_H_
14 struct aplib_struct {
15 unsigned *ringbuf;
16 unsigned write_pointer, read_pointer; /* in words */
17 unsigned ringbuf_size; /* in words */
18 unsigned rbuf_counter; /* read messages */
19 unsigned rbuf_flag1, rbuf_flag2; /* received messages */
20 unsigned *physical_cid; /* logical to physical mapping */
21 unsigned *rel_cid; /* logical to relative (RTC) mapping */
22 unsigned numcells; /* number of logical cells */
23 unsigned numcells_x; /* number of logical cells in x direction */
24 unsigned numcells_y; /* number of logical cells in y direction */
25 unsigned cid, tid; /* this cells logical cell ID and task ID */
26 unsigned cidx, cidy; /* logical cell id in x and y direction */
27 unsigned ack_flag, ack_request;
28 unsigned ok_x, ok_y, ok_xy; /* whether hardware x, y and xy sends are allowed */
33 * the system ringbuffer structure
34 * this is also the old way that tasks accessed the MSC hardware
36 struct ringbuf_struct {
37 void *ringbuf; /* pointer to the ringbuf */
38 void *shared; /* pointer to the shared page */
39 int order; /* arg to __get_free_pages */
40 unsigned write_ptr; /* write pointer into the ringbuf */
41 unsigned vaddr; /* base virtual address of ringbuf for task */
42 unsigned frag_count; /* how many words in the frag queue */
43 unsigned frag_len; /* how many words expected in the frag queue */
44 unsigned sq_fragment[16]; /* if the task switches part way through
45 an op then shove the partial op here */
49 #define APLIB_INIT 1
50 #define APLIB_SYNC 2
51 #define APLIB_GET 3
52 #define APLIB_PUT 4
53 #define APLIB_SEND 5
54 #define APLIB_PROBE 6
55 #define APLIB_POLL 7
56 #define APLIB_XSEND 8
57 #define APLIB_YSEND 9
58 #define APLIB_XYSEND 10
59 #define APLIB_XPUT 11
60 #define APLIB_YPUT 12
61 #define APLIB_XYPUT 13
64 /* message kinds */
65 #define RBUF_SYSTEM 0
66 #define RBUF_SEND 1
67 #define RBUF_X_BRD 2
68 #define RBUF_Y_BRD 3
69 #define RBUF_XY_BRD 4
70 #define RBUF_RPC 5
71 #define RBUF_GET 6
72 #define RBUF_MPI 7
73 #define RBUF_BIGSEND 8
74 #define RBUF_SEEN 0xE
75 #define RBUF_READ 0xF
77 #define APLIB_PAGE_BASE 0xd0000000
78 #define APLIB_PAGE_LEN 8192
80 struct aplib_init {
81 unsigned numcells, cid;
82 unsigned numcells_x, numcells_y;
83 unsigned *phys_cells; /* physical cell list */
84 unsigned *ringbuffer; /* pointer to user supplied ring buffer */
85 unsigned ringbuf_size; /* in words */
89 struct aplib_putget {
90 unsigned cid;
91 unsigned *src_addr, *dest_addr;
92 unsigned size; /* in words */
93 unsigned *dest_flag, *src_flag;
94 unsigned ack;
98 struct aplib_send {
99 /* the ordering here is actually quite important - the parts to be
100 read by the bigrecv function must be in the first 24 bytes */
101 unsigned src_addr;
102 unsigned size;
103 unsigned info1, info2;
104 unsigned flag_addr;
105 volatile unsigned flag;
106 unsigned type;
107 unsigned tag;
108 unsigned cid;
111 #ifdef __KERNEL__
112 #define MAX_PUT_SIZE (1024*1024 - 1) /* in words */
113 #define SMALL_SEND_THRESHOLD 128
116 #endif
118 #endif /* _APLIB_H_ */