Initial cut of the open ath9k htc firmware.
[open-ath9k-htc-firmware.git] / target_firmware / magpie_fw_dev / target / inc / k2 / cmnos_api.h
1 #ifndef __CMNOS_API_H__
2 #define __CMNOS_API_H__
3
4 /*
5  * This file contains wrappers to OS operating system functions
6  * that are available in all versions of the operating system.
7  *
8  * Target software must always use these wrappers to access OS
9  * services -- it may not access any OS services directly.
10  */
11
12 #include "xtensa/config/core.h"
13 #include "xtensa/hal.h"
14 #include "xtensa/xtruntime.h"
15 #include "sys_cfg.h"
16
17 /* cmnos interface */
18 #include "printf_api.h"
19 #include "uart_api.h"
20 #include "dbg_api.h"
21 #include "mem_api.h"
22 #include "misc_api.h"
23 #include "string_api.h"
24 #include "timer_api.h"
25 #include "romp_api.h"
26 #include "allocram_api.h"
27 #include "tasklet_api.h"
28 #include "clock_api.h"
29 #include "intr_api.h"
30 #include "wdt_api.h"
31 #include "eeprom_api.h"
32 #include "usb_api.h"
33
34 #if defined(PROJECT_K2)
35 #if SYSTEM_MODULE_SFLASH
36 #include "sflash_api.h"
37 #endif
38 #endif
39
40 #define AR6K_ROM_START 0x004e0000
41 #define AR6K_ROM_ADDR(byte_offset) (AR6K_ROM_START+(byte_offset))
42 #define TARG_ROM_ADDRS(byte_offset) AR6K_ROM_ADDR(byte_offset)
43
44 #define IML_SIGNAL_UNUSED0_ADDR TARG_ROM_ADDRS(0)   /* Cannot be used -- aligned */
45 #define IML_SIGNAL_ASSERT_ADDR  TARG_ROM_ADDRS(1)   /* Signal an assertion failure */
46 #define IML_SIGNAL_PRINTF_ADDR  TARG_ROM_ADDRS(2)   /* Signal a printf request */
47 #define IML_SIGNAL_UNUSED4_ADDR TARG_ROM_ADDRS(4)   /* Cannot be used -- aligned */
48 #define IML_SIGNAL_UNUSED8_ADDR TARG_ROM_ADDRS(8)   /* Cannot be used -- aligned */
49 #define IML_SIGNAL_UNUSEDC_ADDR TARG_ROM_ADDRS(0xc) /* Cannot be used -- aligned */
50 #define IML_SIGNAL_MASK         0xfffe000f
51 #define IML_LINENUM_SHIFT       4
52
53 #define NOW() xthal_get_ccount()
54
55 #if defined(__XTENSA__)
56 #define _A_BARRIER asm volatile("memw")
57 #else
58 #define _A_BARRIER
59 #endif
60
61 #define A_ASSERT( __bool )                                                  \
62     do {                                                                    \
63         if (0 == (__bool)) {                                                \
64             (void)*((volatile int *)(IML_SIGNAL_ASSERT_ADDR+(__LINE__<<4)));\
65             _A_BARRIER;                                                     \
66         }                                                                   \
67     } while (0)
68
69
70 #define A_IML_IS_ASSERT(vaddr) \
71         (((vaddr) & IML_SIGNAL_MASK) == (IML_SIGNAL_ASSERT_ADDR & IML_SIGNAL_MASK))
72
73
74 #define PRINT_FAILURE_STATE()                                           \
75 do {                                                                    \
76     uint32_t  epc1, epc2, epc3, epc4;                                   \
77                                                                         \
78     asm volatile("rsr %0,%1" : "=r" (epc1) : "n" (EPC_1));              \
79     asm volatile("rsr %0,%1" : "=r" (epc2) : "n" (EPC_2));              \
80     asm volatile("rsr %0,%1" : "=r" (epc3) : "n" (EPC_3));              \
81     asm volatile("rsr %0,%1" : "=r" (epc4) : "n" (EPC_4));              \
82                                                                         \
83     A_PRINTF("\tepc1=0x%x, epc2=0x%x, epc3=0x%x, epc4=0x%x\n",          \
84                 epc1, epc2, epc3, epc4);                                \
85     A_PRINTF("0x%08x, 0x%08x, 0x%08x, \n\r",                            \
86         DEBUG_SYSTEM_STATE, WATCH_DOG_RESET_COUNTER,                    \
87         WATCH_DOG_MAGIC_PATTERN);                                       \
88 } while(0)
89 ////////////////////////////////////////////////////////////////////////////////////
90
91
92 //#define A_CMN(sym)   _A_OS_INDIRECTION_TABLE->cmnos.sym
93 #define A_CMN(sym)   _A_MAGPIE_INDIRECTION_TABLE->cmnos.sym
94
95 #if SYSTEM_MODULE_MEM
96 /* Mem interfaces */
97 #define A_MEMSET(addr, value, size)     \
98     A_CMN(mem._memset((char *)(addr), (int)(value), (int)(size)))
99
100 #define A_MEMZERO(addr, size)           \
101     A_CMN(mem._memset((char *)(addr), (int)0, (int)(size)))
102
103 #define A_MEMCPY(dst, src, size)        \
104     A_CMN(mem._memcpy((char *)(dst), (char *)(src), (int)(size)))
105
106 #define A_MEMMOVE(dst, src, size)       \
107     A_CMN(mem._memmove((char *)(dst), (char *)(src), (int)(size)))
108
109 #define A_MEMCMP(p1, p2, nbytes)        \
110     A_CMN(mem._memcmp)((void *)(p1), (void *)(p2), (int)(nbytes))
111 #else
112 /* Mem interfaces */
113 #define A_MEMSET(addr, value, size)
114
115 #define A_MEMZERO(addr, size)
116
117 #define A_MEMCPY(dst, src, size)
118
119 #define A_MEMMOVE(dst, src, size)
120
121 #define A_MEMCMP(p1, p2, nbytes)
122 #endif
123
124
125 #if 1
126     /* String interfaces */
127     #define A_STRCPY(dst, src)          A_CMN(string._strcpy((dst), (src)))
128     #define A_STRNCPY(dst, src, n)      A_CMN(string._strncpy((dst), (src), (n)))
129     #define A_STRLEN(str)               A_CMN(string._strlen(str))
130     #define A_STRCMP(str1, str2)        A_CMN(string._strcmp((str1), (str2)))
131     #define A_STRNCMP(str1, str2, n)    A_CMN(string._strncmp((str1), (str2), (n)))
132 #endif
133
134 #if SYSTEM_MODULE_PRINT
135 /* Printf support */
136 #define A_PRINTF_INIT()                 A_CMN(printf._printf_init())
137 #define A_PRINTF                        A_CMN(printf._printf)
138 #else
139 #define A_PRINTF_INIT()
140 #define A_PRINTF
141 #endif /* SYSTEM_MODULE_PRINT */
142
143 #if SYSTEM_MODULE_UART
144 /* Serial port support */
145 #define A_UART_INIT()               A_CMN(uart._uart_init())
146
147 #define A_UART_HWINIT(freq, baud)     \
148         A_CMN(uart._uart_hwinit((freq), (baud)))
149
150 #define A_UART_ENABLED()            (HOST_INTEREST->hi_uart_enable)
151
152 #define A_PUTS(str)                 A_CMN(uart._uart_str_out(str))
153
154 #define A_PUTC(ch)                  A_CMN(uart._uart_char_put(ch))
155 #define A_GETC(pCh)                 A_CMN(uart._uart_char_get(pCh))
156
157 #define A_UART_TASK()               A_CMN(uart._uart_task())
158 #define A_UART_CONFIG(x)            A_CMN(uart._uart_config(x))
159
160 #else
161
162 #define A_UART_INIT()
163
164 #define A_UART_HWINIT(freq, baud)
165
166 #define A_UART_ENABLED()
167
168 #define A_PUTS(str)
169
170 #define A_PUTC(ch)
171 #define A_GETC(pCh)
172
173 #define A_UART_TASK()
174 #define A_UART_CONFIG(x)
175
176 #endif
177
178 #if SYSTEM_MODULE_MISC
179 /* Reset Support */
180 #define A_RESET()                        A_CMN(misc._system_reset())
181 #define A_RESET_MAC()                    A_CMN(misc._mac_reset())
182
183 /* Assertion failure */
184 #define A_ASSFAIL(regdump)               A_CMN(misc._assfail((regdump)))
185
186 /* Report a failure to the Host */
187 #define A_REPORT_FAILURE(data, len)      \
188         A_CMN(misc._report_failure_to_host((data), (len)))
189
190 /* UNALIGNED references are used for ASSERTs */
191 #define A_MISALIGNED_LOAD_HANDLER(dump)  A_CMN(misc._misaligned_load_handler(dump))
192
193 /* reture the host interface type */
194 #define A_IS_HOST_PRESENT()             A_CMN(misc._is_host_present())
195 #define A_KBHIT(delay)                  A_CMN(misc._kbhit(delay))
196 #define A_GET_ROM_VER()                 A_CMN(misc._rom_version_get())
197 #else
198 /* Reset Support */
199 #define A_RESET()
200 #define A_RESET_MAC()
201
202 /* Assertion failure */
203 #define A_ASSFAIL(regdump)
204
205 #define A_MISALIGNED_LOAD_HANDLER(dump)
206
207 /* Report a failure to the Host */
208 #define A_REPORT_FAILURE(data, len)
209
210 #define A_IS_HOST_PRESENT()
211 #define A_KBHIT(delay)
212 #define A_GET_ROM_VER()
213 #endif
214
215 #if SYSTEM_MODULE_USB
216 /* debug Support */
217 #define A_USB_INIT()                    A_CMN(usb._usb_init())
218 #define A_USB_ROM_TASK()                A_CMN(usb._usb_rom_task())
219 #define A_USB_FW_TASK()                 A_CMN(usb._usb_fw_task())
220 #define A_USB_INIT_PHY()                A_CMN(usb._usb_init_phy())
221
222 #define A_USB_EP0_SETUP()               A_CMN(usb._usb_ep0_setup())
223 #define A_USB_EP0_TX_DATA()             A_CMN(usb._usb_ep0_tx_data())
224 #define A_USB_EP0_RX_DATA()             A_CMN(usb._usb_ep0_rx_data())
225
226 #define A_USB_GET_CONFIG()              A_CMN(usb._usb_get_configuration())
227 #define A_USB_SET_CONFIG()              A_CMN(usb._usb_set_configuration())
228
229 #define A_USB_GET_INTERFACE()           A_CMN(usb._usb_get_interface())
230 #define A_USB_SET_INTERFACE()           A_CMN(usb._usb_set_interface())
231
232 #define A_USB_STANDARD_CMD()            A_CMN(usb._usb_standard_cmd())
233 #define A_USB_VENDOR_CMD()              A_CMN(usb._usb_vendor_cmd())
234
235 #define A_USB_POWER_OFF()               A_CMN(usb._usb_power_off())
236 #define A_USB_RESET_FIFO()              A_CMN(usb._usb_reset_fifo())
237 #define A_USB_GEN_WDT()                 A_CMN(usb._usb_gen_wdt())
238 #define A_USB_JUMP_BOOT()               A_CMN(usb._usb_jump_boot())
239
240 #define A_USB_GET_DESCRIPTOR()          A_CMN(usb._usb_get_descriptor())
241 #define A_USB_SET_ADDRESS()             A_CMN(usb._usb_set_address())
242 #define A_USB_SET_FEATURE()             A_CMN(usb._usb_set_feature())
243 #define A_USB_CLEAR_FEATURE()           A_CMN(usb._usb_clr_feature())
244
245 #define A_USB_GET_STATUS()              A_CMN(usb._usb_get_status())
246 #define A_USB_SETUP_DESC()              A_CMN(usb._usb_setup_desc())
247 #define A_USB_STATUS_IN()               A_CMN(usb._usb_status_in())
248 #define A_USB_REG_OUT()                 A_CMN(usb._usb_reg_out())
249
250 #define A_USB_EP0_TX()                  A_CMN(usb._usb_ep0_tx())
251 #define A_USB_EP0_RX()                  A_CMN(usb._usb_ep0_rx())
252 #define A_USB_CLK_INIT()                A_CMN(usb._usb_clk_init())
253
254 #else
255 #define A_USB_INIT()
256 #define A_USB_TASK()
257 #define A_USB_INIT_PHY()
258
259 #define A_USB_EP0_SETUP()
260 #define A_USB_EP0_TX()
261 #define A_USB_EP0_RX()
262
263 #define A_USB_GET_CONFIG()
264 #define A_USB_SET_CONFIG()
265
266 #define A_USB_GET_INTERFACE()
267 #define A_USB_SET_INTERFACE()
268
269 #define A_USB_STANDARD_CMD()
270 #define A_USB_VENDOR_CMD()
271
272 #define A_USB_POWER_OFF()
273 #define A_USB_RESET_FIFO()
274 #define A_USB_GEN_WDT()
275 #define A_USB_JUMP_BOOT()
276
277 #define A_USB_GET_DESCRIPTOR()
278 #define A_USB_SET_ADDRESS()
279 #define A_USB_SET_FEATURE()
280 #define A_USB_CLEAR_FEATURE()
281
282 #define A_USB_GET_STATUS()
283 #define A_USB_SETUP_DESC()
284
285
286 #define A_USB_STATUS_IN()
287 #define A_USB_REG_OUT()
288
289 #define A_USB_EP0_TX()
290 #define A_USB_EP0_RX()
291
292 #define A_USB_CLK_INIT()
293 #endif
294
295 #if SYSTEM_MODULE_INTR
296 /* Low-level interrupt support intended for use by OS modules */
297 #define A_INTR_GET_INTRENABLE()         A_CMN(intr._get_intrenable())
298 #define A_INTR_SET_INTRENABLE(val)      A_CMN(intr._set_intrenable(val))
299 #define A_INTR_GET_INTRPENDING()        A_CMN(intr._get_intrpending())
300 #define A_INTR_UNBLOCK_ALL_INTRLVL()    A_CMN(intr._unblock_all_intrlvl())
301
302 /* Interrupt support */
303 #define A_INTR_INIT()                   A_CMN(intr._intr_init())
304
305 #define  A_INTR_DISABLE(pOld)                           \
306     do {                                                \
307         *(pOld) = A_CMN(intr._intr_disable());        \
308     } while (0)
309
310 #define  A_INTR_RESTORE(old)            A_CMN(intr._intr_restore((old)))
311
312 #define A_INVOKE_ISR(inum)              A_CMN(intr._intr_invoke_isr(inum))
313
314 #define A_INTR_MASK(inum)               A_CMN(intr._intr_mask_inum(inum))
315 #define A_INTR_UNMASK(inum)             A_CMN(intr._intr_unmask_inum(inum))
316
317 #define A_ATTACH_ISR(inum, isr, arg)    A_CMN(intr._intr_attach_isr(inum, isr, arg))
318 #else
319 #define A_INTR_INIT()
320 #define  A_INTR_DISABLE(pOld)
321 #define  A_INTR_RESTORE(old)
322
323 #define A_INTR_GET_INTRENABLE()
324 #define A_INTR_SET_INTRENABLE(val)
325 #define A_INTR_GET_INTRPENDING()
326 #define A_INTR_UNBLOCK_ALL_INTRLVL()
327 #define A_INVOKE_ISR(inum)
328 #define A_INTR_MASK(inum)
329 #define A_INTR_UNMASK(inum)
330 #define A_ATTACH_ISR(inum, isr, arg)
331
332 #endif
333
334 /* Tasklet Support */
335 #define A_TASKLET_INIT()                    A_CMN(tasklet._tasklet_init())
336 #define A_TASKLET_INIT_TASK(f, arg, t)      A_CMN(tasklet._tasklet_init_task(f, arg, t))
337 #define A_TASKLET_DISABLE(t)                A_CMN(tasklet._tasklet_disable(t))
338 #define A_TASKLET_SCHEDULE(t)               A_CMN(tasklet._tasklet_schedule(t))
339 #define A_TASKLET_RUN()                     A_CMN(tasklet._tasklet_run())
340
341
342 /* RAM Allocation Support */
343 #if defined(__mips__)
344 #define alloc_arena_start _end
345 #endif
346 #if defined(__XTENSA__)
347 #define alloc_arena_start _end
348 #endif
349
350 #if SYSTEM_MODULE_CLOCK
351
352 #define A_CLOCK_INIT(refclk_guess)      A_CMN(clock._clock_init(refclk_guess))
353 #define A_CLOCK_TICK()                  A_CMN(clock._clock_tick())
354 #define A_CLOCK_GET_TICK()              A_CMN(clock._clock_get_tick())
355
356 /*
357  * Get the number of millisecond ticks since the system was started.
358  * Note that this only approximates 1Ms.  It's actually 32 ticks of
359  * a 32KHz clock.
360  *
361  * Returns a A_UINT32 value.
362  */
363 #define A_MILLISECONDS()                A_CMN(clock._milliseconds())
364
365 /*
366  * Get the frequency of the reference clock, expressed as
367  * an A_refclk_speed_t.
368  */
369 #define A_REFCLK_SPEED_GET()            A_CMN(clock._refclk_speed_get())
370
371 /* Spin delay */
372 #define A_DELAY_USECS(us)               A_CMN(clock._delay_us(us))
373
374 #define A_UART_FREQUENCY()              A_CMN(clock._uart_frequency())
375
376 #define A_CLOCKREGS_INIT()              A_CMN(clock._clockregs_init())
377
378 /* which_band is either A_BAND_24GHZ or A_BAND_5GHZ */
379 #define A_WLAN_BAND_SET(which_band)      \
380         A_CMN(clock._wlan_band_set(which_band))
381
382 /* Called whenever the system clock changes speed */
383 #define A_SYSCLK_CHANGE(mhz)               A_CMN(clock._sysclk_change(mhz))
384
385 #define A_SYSCLK_GET()               A_CMN(clock._sysclk_get())
386
387 #else
388
389 #define A_CLOCK_INIT(refclk_guess)
390 #define A_CLOCK_TICK()
391 #define A_CLOCK_GET_TICK()
392 #define A_MILLISECONDS()
393 #define A_REFCLK_SPEED_GET()
394 #define A_DELAY_USECS(us)
395 #define A_UART_FREQUENCY()
396 #define A_CLOCKREGS_INIT()
397 #define A_WLAN_BAND_SET(which_band)
398 #define A_SYSCLK_CHANGE(mhz)
399 #define A_SYSCLK_GET()
400
401 #endif
402
403 // Timer
404 #define A_INIT_TIMER(pTimer, pFunction, pArg) \
405     A_CMN(timer._timer_setfn((pTimer), (pFunction), (pArg)))
406
407 /* Set a (possibly periodic) timer for "period" Milliseconds. */
408 #define A_TIMEOUT_MS(pTimer, period) \
409     A_CMN(timer._timer_arm((pTimer), (period)))
410
411 #define A_UNTIMEOUT(pTimer) \
412     A_CMN(timer._timer_disarm(pTimer))
413
414 #define A_TIMER_RUN() \
415     A_CMN(timer._timer_run())
416
417 #define A_PCI_BOOT_INIT() \
418     A_CMN(pci.pci_boot_init()) 
419
420 #define A_GMAC_BOOT_INIT() \
421     A_CMN(gmac.gmac_boot_init()) 
422
423 #if SYSTEM_MODULE_ALLOCRAM
424 /* Default size of ALLOCRAM area */
425 #define ARENA_SZ_DEFAULT 12000
426
427 #define A_ALLOCRAM_INIT(arena_start, arena_size)                        \
428         do {                                                            \
429                 extern unsigned int alloc_arena_start;                  \
430                 void *astart;                                           \
431                 int asize;                                              \
432                 astart = (arena_start) ? (void *)(arena_start) : &alloc_arena_start; \
433                 asize = (arena_size) ? (arena_size) : (ARENA_SZ_DEFAULT); \
434                 A_CMN(allocram.cmnos_allocram_init((astart), (asize))); \
435         } while (0)
436
437 #define A_ALLOCRAM(nbytes)      A_CMN(allocram.cmnos_allocram(0, (nbytes)))
438
439 #define A_ALLOCRAM_DEBUG()    A_CMN(allocram.cmnos_allocram_debug())
440
441 #else
442 #define A_ALLOCRAM_INIT(arena_start, arena_size)
443 #define A_ALLOCRAM(nbytes)
444 #define A_ALLOCRAM_DEBUG()
445 #endif
446
447 #if SYSTEM_MODULE_ROM_PATCH
448
449 #define A_ROMP_INIT()           A_CMN(romp._romp_init())
450 #define A_ROMP_DOWNLOAD(x)      A_CMN(romp._romp_download(x))
451 #define A_ROMP_DECODE(addr)     A_CMN(romp._romp_decode(addr))
452 #define A_ROMP_INSTALL()        A_CMN(romp._romp_install())
453 #else
454 #define A_ROMP_INIT()
455 #define A_ROMP_DOWNLOAD(x)
456 #define A_ROMP_DECODE(addr)
457 #define A_ROMP_INSTALL()
458 #endif
459
460 #if SYSTEM_MODULE_WDT
461
462 #define A_WDT_INIT()            A_CMN(wdt_timer._wdt_init())
463 #define A_WDT_ENABLE()          A_CMN(wdt_timer._wdt_enable())
464 #define A_WDT_DISABLE()         A_CMN(wdt_timer._wdt_disable())
465 #define A_WDT_SET(t)            A_CMN(wdt_timer._wdt_set(t))
466 #define A_WDT_TASK()            A_CMN(wdt_timer._wdt_task())
467 #define A_WDT_LASTBOOT()        A_CMN(wdt_timer._wdt_last_boot())
468 #define A_WDT_RESET()           A_CMN(wdt_timer._wdt_reset())
469
470 #else
471 #define A_WDT_INIT()
472 #define A_WDT_ENABLE()
473 #define A_WDT_DISABLE()
474 #define A_WDT_SET(t)
475 #define A_WDT_TASK()
476 #define A_WDT_LASTBOOT()
477 #define A_WDT_RESET()
478 #endif
479
480
481 #if SYSTEM_MODULE_EEPROM
482 #define A_EEP_INIT()                    A_CMN(eep._eep_init())
483 #define A_EEP_READ(off, len, buf)       A_CMN(eep._eep_read(off, len, buf))
484 #define A_EEP_WRITE(off, len, buf)      A_CMN(eep._eep_write(off, len, buf))
485 #define A_EEP_IS_EXIST()                A_CMN(eep._eep_is_exist())
486 #else
487 #define A_EEP_INIT()
488 #define A_EEP_READ(off, len, buf)
489 #define A_EEP_WRITE(off, len, buf)
490 #define A_EEP_IS_EXIST()
491 #endif
492
493
494
495 struct _A_os_linkage_check; /* OS-dependent */
496
497 typedef struct _A_cmnos_indirection_table {
498     int (* hal_linkage_check)(int sz, struct _A_os_linkage_check *);
499     unsigned int *start_bss;
500     void (* app_start)(void);
501
502 #if SYSTEM_MODULE_MEM
503     struct mem_api    mem;
504 #endif
505
506 #if SYSTEM_MODULE_MISC
507     struct misc_api     misc;
508 #endif
509
510 #if SYSTEM_MODULE_PRINT
511     struct printf_api    printf;
512 #endif
513
514 #if SYSTEM_MODULE_UART
515     struct uart_api      uart;
516 #endif
517
518 #if SYSTEM_MODULE_DBG
519 #if !MOVE_DBG_TO_RAM // move to firmware not in cmnos
520     struct dbg_api      dbg;
521 #endif
522 #endif
523 #if SYSTEM_MODULE_PCI
524    struct pci_api pci;
525 #endif
526
527 #if SYSTEM_MODULE_GMAC
528    struct gmac_api gmac;
529 #endif
530
531 #if SYSTEM_MODULE_USB
532     struct usb_api      usb;
533 #endif
534
535 #if SYSTEM_MODULE_CLOCK
536     struct clock_api     clock;
537 #endif
538
539 #if SYSTEM_MODULE_TIMER
540     struct timer_api     timer;
541 #endif
542
543 #if SYSTEM_MODULE_INTR
544     struct intr_api     intr;
545 #endif
546
547 #if SYSTEM_MODULE_ALLOCRAM
548     struct allocram_api     allocram;
549 #endif
550
551 #if SYSTEM_MODULE_ROM_PATCH
552     struct romp_api     romp;
553 #endif
554
555 #if SYSTEM_MODULE_WDT
556     struct wdt_api     wdt_timer;
557 #endif
558
559 #if SYSTEM_MODULE_EEPROM
560     struct eep_api     eep;
561 #endif
562
563     struct string_api   string;
564     struct tasklet_api  tasklet;
565
566 } _A_cmnos_indirection_table_t;
567
568 /* Module installation  for cmnos modules */
569
570 #if SYSTEM_MODULE_MEM
571 extern void cmnos_mem_module_install(struct mem_api *);
572 #endif
573
574 #if SYSTEM_MODULE_MISC
575 extern void cmnos_misc_module_install(struct misc_api *);
576 #endif
577
578 #if SYSTEM_MODULE_PRINT
579 extern void cmnos_printf_module_install(struct printf_api *);
580 #endif
581
582 #if SYSTEM_MODULE_UART
583 extern void cmnos_uart_module_install(struct uart_api *);
584 #endif
585
586 #if SYSTEM_MODULE_DBG
587 extern void cmnos_dbg_module_install(struct dbg_api *);
588 #endif
589
590 #if SYSTEM_MODULE_USB
591 extern void cmnos_usb_module_install(struct usb_api *);
592 #endif
593
594 #if SYSTEM_MODULE_INTR
595 extern void cmnos_intr_module_install(struct intr_api *);
596 #endif
597
598 #if SYSTEM_MODULE_CLOCK
599 extern void cmnos_clock_module_install(struct clock_api *);
600 #endif
601
602 #if SYSTEM_MODULE_TIMER
603 extern void cmnos_timer_module_install(struct timer_api *);
604 #endif
605
606 #if SYSTEM_MODULE_ALLOCRAM
607 extern void cmnos_allocram_module_install(struct allocram_api *);
608 #endif
609
610 #if SYSTEM_MODULE_ROM_PATCH
611 extern void cmnos_romp_module_install(struct romp_api *);
612 #endif
613
614 #if SYSTEM_MODULE_WDT
615 extern void cmnos_wdt_module_install(struct wdt_api *);
616 #endif
617
618 #if SYSTEM_MODULE_EEPROM
619 extern void cmnos_eep_module_install(struct eep_api *);
620 #endif
621
622 #if SYSTEM_MODULE_PCI
623 extern void cmnos_pci_module_install(struct pci_api *);
624 #endif
625
626 extern void cmnos_tasklet_module_install(struct tasklet_api *);
627
628 extern void cmnos_string_module_install(struct string_api *tbl);
629
630 #endif /* __CMNOS_API_H__ */