2 * Copyright 1996 The Australian National University.
3 * Copyright 1996 Fujitsu Laboratories Limited
5 * This software may be distributed under the terms of the Gnu
6 * Public License version 2 or later
9 /* aplib kernel interface definition */
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 */
58 #define APLIB_XYSEND 10
61 #define APLIB_XYPUT 13
73 #define RBUF_BIGSEND 8
77 #define APLIB_PAGE_BASE 0xd0000000
78 #define APLIB_PAGE_LEN 8192
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 */
91 unsigned *src_addr
, *dest_addr
;
92 unsigned size
; /* in words */
93 unsigned *dest_flag
, *src_flag
;
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 */
103 unsigned info1
, info2
;
105 volatile unsigned flag
;
112 #define MAX_PUT_SIZE (1024*1024 - 1) /* in words */
113 #define SMALL_SEND_THRESHOLD 128
118 #endif /* _APLIB_H_ */