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