2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
5 Desc: Serial hidd initialization code.
9 #include <aros/debug.h>
11 #include <exec/types.h>
12 #include <exec/alerts.h>
14 #include <aros/symbolsets.h>
18 #include <proto/oop.h>
19 #include <proto/exec.h>
21 #include "serial_intern.h"
23 #include LC_LIBDEFS_FILE
25 void serial_int(void *data
, void *data2
);
27 static inline BOOL
GetIRQs(int *irq
);
29 struct Library
*ProcessorBase
= OpenResource(PROCESSORNAME
);
33 struct TagItem tags
[] = {
34 { GCIT_Model
, (IPTR
)&pvr
},
42 irq
[0] = INTR_UIC1_UART0
;
43 irq
[1] = INTR_UIC0_UART1
;
44 irq
[2] = INTR_UIC1_UART2
;
45 irq
[3] = INTR_UIC1_UART3
;
62 static int PPC4xxSer_Init(LIBBASETYPEPTR LIBBASE
)
65 struct class_static_data
*csd
= &LIBBASE
->hdg_csd
; /* SerialHidd static data */
67 EnterFunc(bug("SerialHIDD_Init()\n"));
69 if (GetIRQs(&csd
->cs_IRQ
[0])) {
70 /* Install interrupts */
71 for (i
= 0; i
< 4; i
++)
72 KrnAddHandler(csd
->cs_IRQ
[i
], serial_int
, csd
->cs_Unit
[i
]);
74 D(bug(" Got Interrupts\n"));
75 ReturnInt("SerialHIDD_Init", ULONG
, TRUE
);
78 ReturnInt("SerialHIDD_Init", ULONG
, FALSE
);
81 ADD2INITLIB(PPC4xxSer_Init
, 0)