-
Notifications
You must be signed in to change notification settings - Fork 33
/
device.h
69 lines (50 loc) · 1.29 KB
/
device.h
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
#ifndef __A314_DEVICE_H
#define __A314_DEVICE_H
#include <exec/types.h>
#include <exec/libraries.h>
#include <exec/tasks.h>
#include <exec/ports.h>
#include <exec/interrupts.h>
#include <libraries/dos.h>
#include "protocol.h"
struct A314Device
{
struct Library lib; // sizeof(struct Library) == 34
BPTR saved_seg_list;
BOOL running;
#if defined(MODEL_TD) || defined(MODEL_FE)
struct ComArea *ca; // offsetof(ca) == 40
#elif defined(MODEL_CP)
ULONG clockport_address; // offsetof(clockport_address) == 40
#endif
struct Task task; // offsetof(task) == 44
#if defined(MODEL_TD)
ULONG bank_address[4];
UWORD is_a600;
ULONG fw_flags;
#elif defined(MODEL_FE)
ULONG a314_mem_address;
#endif
#if defined(MODEL_TD) || defined(MODEL_FE)
struct Interrupt vertb_interrupt;
#endif
struct Interrupt int_x_interrupt;
UWORD interrupt_number;
#if defined(MODEL_CP)
struct ComAreaPtrs cap;
void *first_chunk;
#endif
struct MsgPort task_mp;
struct List active_sockets;
struct Socket *send_queue_head;
struct Socket *send_queue_tail;
UBYTE next_stream_id;
};
#if defined(MODEL_TD) || defined(MODEL_FE)
#define CAP_PTR(dev) (&(dev->ca->cap))
#elif defined(MODEL_CP)
#define CAP_PTR(dev) (&(dev->cap))
#endif
extern const char device_name[];
extern const char id_string[];
#endif /* __A314_DEVICE_H */