GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / drivers / staging / tidspbridge / include / dspbridge / dbldefs.h
blobbf4fb99529aecdb602a67e597182d48a60a11fc3
1 /*
2 * dbldefs.h
4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * Copyright (C) 2005-2006 Texas Instruments, Inc.
8 * This package is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
12 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17 #ifndef DBLDEFS_
18 #define DBLDEFS_
21 * Bit masks for dbl_flags.
23 #define DBL_NOLOAD 0x0 /* Don't load symbols, code, or data */
24 #define DBL_SYMB 0x1 /* load symbols */
25 #define DBL_CODE 0x2 /* load code */
26 #define DBL_DATA 0x4 /* load data */
27 #define DBL_DYNAMIC 0x8 /* dynamic load */
28 #define DBL_BSS 0x20 /* Unitialized section */
30 #define DBL_MAXPATHLENGTH 255
33 * ======== dbl_flags ========
34 * Specifies whether to load code, data, or symbols
36 typedef s32 dbl_flags;
39 * ======== dbl_sect_info ========
40 * For collecting info on overlay sections
42 struct dbl_sect_info {
43 const char *name; /* name of section */
44 u32 sect_run_addr; /* run address of section */
45 u32 sect_load_addr; /* load address of section */
46 u32 size; /* size of section (target MAUs) */
47 dbl_flags type; /* Code, data, or BSS */
51 * ======== dbl_symbol ========
52 * (Needed for dynamic load library)
54 struct dbl_symbol {
55 u32 value;
59 * ======== dbl_alloc_fxn ========
60 * Allocate memory function. Allocate or reserve (if reserved == TRUE)
61 * "size" bytes of memory from segment "space" and return the address in
62 * *dsp_address (or starting at *dsp_address if reserve == TRUE). Returns 0 on
63 * success, or an error code on failure.
65 typedef s32(*dbl_alloc_fxn) (void *hdl, s32 space, u32 size, u32 align,
66 u32 *dsp_address, s32 seg_id, s32 req,
67 bool reserved);
70 * ======== dbl_free_fxn ========
71 * Free memory function. Free, or unreserve (if reserved == TRUE) "size"
72 * bytes of memory from segment "space"
74 typedef bool(*dbl_free_fxn) (void *hdl, u32 addr, s32 space, u32 size,
75 bool reserved);
78 * ======== dbl_log_write_fxn ========
79 * Function to call when writing data from a section, to log the info.
80 * Can be NULL if no logging is required.
82 typedef int(*dbl_log_write_fxn) (void *handle,
83 struct dbl_sect_info *sect, u32 addr,
84 u32 bytes);
87 * ======== dbl_sym_lookup ========
88 * Symbol lookup function - Find the symbol name and return its value.
90 * Parameters:
91 * handle - Opaque handle
92 * parg - Opaque argument.
93 * name - Name of symbol to lookup.
94 * sym - Location to store address of symbol structure.
96 * Returns:
97 * TRUE: Success (symbol was found).
98 * FALSE: Failed to find symbol.
100 typedef bool(*dbl_sym_lookup) (void *handle, void *parg, void *rmm_handle,
101 const char *name, struct dbl_symbol ** sym);
104 * ======== dbl_write_fxn ========
105 * Write memory function. Write "n" HOST bytes of memory to segment "mtype"
106 * starting at address "dsp_address" from the buffer "buf". The buffer is
107 * formatted as an array of words appropriate for the DSP.
109 typedef s32(*dbl_write_fxn) (void *hdl, u32 dsp_address, void *buf,
110 u32 n, s32 mtype);
113 * ======== dbl_attrs ========
115 struct dbl_attrs {
116 dbl_alloc_fxn alloc;
117 dbl_free_fxn free;
118 void *rmm_handle; /* Handle to pass to alloc, free functions */
119 dbl_write_fxn write;
120 void *input_params; /* Handle to pass to write, cinit function */
122 dbl_log_write_fxn log_write;
123 void *log_write_handle;
125 /* Symbol matching function and handle to pass to it */
126 dbl_sym_lookup sym_lookup;
127 void *sym_handle;
128 void *sym_arg;
131 * These file manipulation functions should be compatible with the
132 * "C" run time library functions of the same name.
134 s32(*fread) (void *, size_t, size_t, void *);
135 s32(*fseek) (void *, long, int);
136 s32(*ftell) (void *);
137 s32(*fclose) (void *);
138 void *(*fopen) (const char *, const char *);
141 #endif /* DBLDEFS_ */