initial import
[ICEs.git] / 153708 / ice.i.1
1 typedef unsigned int __kernel_size_t;
2 typedef unsigned int u32;
3 typedef __kernel_size_t size_t;
4 typedef int (*initcall_t)(void);
5 struct cdev {
6 };
7 extern u32 iop13xx_atux_mem_base;
8 static inline __attribute__((always_inline)) void * __iop13xx_ioremap(unsigned long cookie, size_t size, unsigned long flags) {
9 void * retval;
10 switch (cookie) {
11 case 0x80000000UL ... (0x80000000UL + 0x3a000000UL - 1): if (__builtin_expect(!!(!iop13xx_atux_mem_base), 0)) retval = ((void *)0);
12 break;
13 default: retval = __ioremap(cookie, size, flags);
14 }
15 };
16 struct imu_dev {
17 struct cdev cdev;
18 };
19 static struct imu_dev imu[4];
20 static int imu_major = 0;
21 void init_callback(int queueid) {
22 }
23 void error_callback(int queueid) {
24 }
25 static int __attribute__ ((__section__ (".init.text"))) imu_dev_init(void) {
26 int err, i;
27 char *queue_base;
28 for (i = 1;
29 i < 4;
30 i++) {
31 if (cdev_add(&imu[i].cdev, (((imu_major) << 20) | (i)), 1)) {
32 printk("<4>" "Error cdev_add imu%i\n", i);
33 }
34 queue_base = __iop13xx_ioremap(((128*1024*1024) + (i * (16*64))), ((16*64)), 0);
35 err = iop_queue_init(i, (void *)(128*1024*1024) + (i * (16*64)), queue_base, 64, 16, init_callback, error_callback);
36 }
37 }
38 static initcall_t __initcall_imu_dev_init __attribute__((__used__)) __attribute__((__section__(".initcall" "6" ".init"))) = imu_dev_init;