-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeviceinit.c
76 lines (61 loc) · 1.79 KB
/
deviceinit.c
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
70
71
72
73
74
/*
devinit.c
(C) 2018 Henryk Richter <[email protected]>
initialization structures and data
*/
#include <proto/exec.h>
#include <proto/utility.h>
#include <proto/dos.h>
#include <dos/dostags.h>
#include <utility/tagitem.h>
#include <exec/lists.h>
#ifdef HAVE_VERSION_H
#include "version.h"
#endif
#include "device.h"
#include "macros.h"
#include <exec/initializers.h>
#define xstr(a) str(a)
#define str(a) #a
#ifndef DEVICEEXTRA
#define DEVICEEXTRA
#endif
static const char _DeviceVersionString[] = "$VER: " xstr(DEVICENAME) " " xstr(DEVICEVERSION) "." xstr(DEVICEREVISION) xstr(DEVICEEXTRA) " (" xstr(DEVICEDATE) ")";
const char *DeviceVersionString = (const char *)_DeviceVersionString;
const char DeviceName[] = xstr(DEVICENAME);
const APTR DeviceFunctions[] = {
(APTR) DevOpen,
(APTR) DevClose,
(APTR) DevExpunge,
(APTR) LibNull,
(APTR) DevBeginIO,
(APTR) DevAbortIO,
(APTR) -1
};
#define WORDINIT(_a_) UWORD _a_ ##W1; UWORD _a_ ##W2; UWORD _a_ ##ARG;
#define LONGINIT(_a_) UBYTE _a_ ##A1; UBYTE _a_ ##A2; ULONG _a_ ##ARG;
struct DeviceInitData
{
WORDINIT(w1)
LONGINIT(l1)
WORDINIT(w2)
WORDINIT(w3)
WORDINIT(w4)
LONGINIT(l2)
ULONG end_initlist;
} DeviceInitializers =
{
INITBYTE( STRUCTOFFSET( Node, ln_Type), NT_DEVICE),
0x80, (UBYTE) ((LONG)STRUCTOFFSET( Node, ln_Name)), (ULONG) &DeviceName[0],
INITBYTE( STRUCTOFFSET(Library,lib_Flags), LIBF_SUMUSED|LIBF_CHANGED ),
INITWORD( STRUCTOFFSET(Library,lib_Version), DEVICEVERSION ),
INITWORD( STRUCTOFFSET(Library,lib_Revision), DEVICEREVISION ),
0x80, (UBYTE) ((LONG)STRUCTOFFSET(Library,lib_IdString)), (ULONG) &_DeviceVersionString[6],
(ULONG) 0
};
const APTR DeviceInitTab[] = {
(APTR) sizeof( DEVBASETYPE ),
(APTR) &DeviceFunctions,
(APTR) &DeviceInitializers,
(APTR) DevInit
};