• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/staging/tidspbridge/include/dspbridge/
1/*
2 * dspapi.h
3 *
4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5 *
6 * Includes the wrapper functions called directly by the
7 * DeviceIOControl interface.
8 *
9 * Notes:
10 *   Bridge services exported to Bridge driver are initialized by the DSPAPI on
11 *   behalf of the Bridge driver. Bridge driver must not call module Init/Exit
12 *   functions.
13 *
14 *   To ensure Bridge driver binary compatibility across different platforms,
15 *   for the same processor, a Bridge driver must restrict its usage of system
16 *   services to those exported by the DSPAPI library.
17 *
18 * Copyright (C) 2005-2006 Texas Instruments, Inc.
19 *
20 * This package is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License version 2 as
22 * published by the Free Software Foundation.
23 *
24 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
25 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
26 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 */
28
29#ifndef DSPAPI_
30#define DSPAPI_
31
32#include <dspbridge/dspapi-ioctl.h>
33
34/* This BRD API Library Version: */
35#define BRD_API_MAJOR_VERSION   (u32)8	/* .8x - Alpha, .9x - Beta, 1.x FCS */
36#define BRD_API_MINOR_VERSION   (u32)0
37
38/*
39 *  ======== api_call_dev_ioctl ========
40 *  Purpose:
41 *      Call the (wrapper) function for the corresponding API IOCTL.
42 *  Parameters:
43 *      cmd:        IOCTL id, base 0.
44 *      args:       Argument structure.
45 *      result:
46 *  Returns:
47 *      0 if command called; -EINVAL if command not in IOCTL
48 *      table.
49 *  Requires:
50 *  Ensures:
51 */
52extern int api_call_dev_ioctl(unsigned int cmd,
53				      union trapped_args *args,
54				      u32 *result, void *pr_ctxt);
55
56/*
57 *  ======== api_init ========
58 *  Purpose:
59 *      Initialize modules used by Bridge API.
60 *      This procedure is called when the driver is loaded.
61 *  Parameters:
62 *  Returns:
63 *      TRUE if success; FALSE otherwise.
64 *  Requires:
65 *  Ensures:
66 */
67extern bool api_init(void);
68
69/*
70 *  ======== api_init_complete2 ========
71 *  Purpose:
72 *      Perform any required bridge initialization which cannot
73 *      be performed in api_init() or dev_start_device() due
74 *      to the fact that some services are not yet
75 *      completely initialized.
76 *  Parameters:
77 *  Returns:
78 *      0:        Allow this device to load
79 *      -EPERM:      Failure.
80 *  Requires:
81 *      Bridge API initialized.
82 *  Ensures:
83 */
84extern int api_init_complete2(void);
85
86/*
87 *  ======== api_exit ========
88 *  Purpose:
89 *      Exit all modules initialized in api_init(void).
90 *      This procedure is called when the driver is unloaded.
91 *  Parameters:
92 *  Returns:
93 *  Requires:
94 *      api_init(void) was previously called.
95 *  Ensures:
96 *      Resources acquired in api_init(void) are freed.
97 */
98extern void api_exit(void);
99
100/* MGR wrapper functions */
101extern u32 mgrwrap_enum_node_info(union trapped_args *args, void *pr_ctxt);
102extern u32 mgrwrap_enum_proc_info(union trapped_args *args, void *pr_ctxt);
103extern u32 mgrwrap_register_object(union trapped_args *args, void *pr_ctxt);
104extern u32 mgrwrap_unregister_object(union trapped_args *args, void *pr_ctxt);
105extern u32 mgrwrap_wait_for_bridge_events(union trapped_args *args,
106					  void *pr_ctxt);
107
108extern u32 mgrwrap_get_process_resources_info(union trapped_args *args,
109					      void *pr_ctxt);
110
111/* CPRC (Processor) wrapper Functions */
112extern u32 procwrap_attach(union trapped_args *args, void *pr_ctxt);
113extern u32 procwrap_ctrl(union trapped_args *args, void *pr_ctxt);
114extern u32 procwrap_detach(union trapped_args *args, void *pr_ctxt);
115extern u32 procwrap_enum_node_info(union trapped_args *args, void *pr_ctxt);
116extern u32 procwrap_enum_resources(union trapped_args *args, void *pr_ctxt);
117extern u32 procwrap_get_state(union trapped_args *args, void *pr_ctxt);
118extern u32 procwrap_get_trace(union trapped_args *args, void *pr_ctxt);
119extern u32 procwrap_load(union trapped_args *args, void *pr_ctxt);
120extern u32 procwrap_register_notify(union trapped_args *args, void *pr_ctxt);
121extern u32 procwrap_start(union trapped_args *args, void *pr_ctxt);
122extern u32 procwrap_reserve_memory(union trapped_args *args, void *pr_ctxt);
123extern u32 procwrap_un_reserve_memory(union trapped_args *args, void *pr_ctxt);
124extern u32 procwrap_map(union trapped_args *args, void *pr_ctxt);
125extern u32 procwrap_un_map(union trapped_args *args, void *pr_ctxt);
126extern u32 procwrap_flush_memory(union trapped_args *args, void *pr_ctxt);
127extern u32 procwrap_stop(union trapped_args *args, void *pr_ctxt);
128extern u32 procwrap_invalidate_memory(union trapped_args *args, void *pr_ctxt);
129extern u32 procwrap_begin_dma(union trapped_args *args, void *pr_ctxt);
130extern u32 procwrap_end_dma(union trapped_args *args, void *pr_ctxt);
131
132/* NODE wrapper functions */
133extern u32 nodewrap_allocate(union trapped_args *args, void *pr_ctxt);
134extern u32 nodewrap_alloc_msg_buf(union trapped_args *args, void *pr_ctxt);
135extern u32 nodewrap_change_priority(union trapped_args *args, void *pr_ctxt);
136extern u32 nodewrap_connect(union trapped_args *args, void *pr_ctxt);
137extern u32 nodewrap_create(union trapped_args *args, void *pr_ctxt);
138extern u32 nodewrap_delete(union trapped_args *args, void *pr_ctxt);
139extern u32 nodewrap_free_msg_buf(union trapped_args *args, void *pr_ctxt);
140extern u32 nodewrap_get_attr(union trapped_args *args, void *pr_ctxt);
141extern u32 nodewrap_get_message(union trapped_args *args, void *pr_ctxt);
142extern u32 nodewrap_pause(union trapped_args *args, void *pr_ctxt);
143extern u32 nodewrap_put_message(union trapped_args *args, void *pr_ctxt);
144extern u32 nodewrap_register_notify(union trapped_args *args, void *pr_ctxt);
145extern u32 nodewrap_run(union trapped_args *args, void *pr_ctxt);
146extern u32 nodewrap_terminate(union trapped_args *args, void *pr_ctxt);
147extern u32 nodewrap_get_uuid_props(union trapped_args *args, void *pr_ctxt);
148
149/* STRM wrapper functions */
150extern u32 strmwrap_allocate_buffer(union trapped_args *args, void *pr_ctxt);
151extern u32 strmwrap_close(union trapped_args *args, void *pr_ctxt);
152extern u32 strmwrap_free_buffer(union trapped_args *args, void *pr_ctxt);
153extern u32 strmwrap_get_event_handle(union trapped_args *args, void *pr_ctxt);
154extern u32 strmwrap_get_info(union trapped_args *args, void *pr_ctxt);
155extern u32 strmwrap_idle(union trapped_args *args, void *pr_ctxt);
156extern u32 strmwrap_issue(union trapped_args *args, void *pr_ctxt);
157extern u32 strmwrap_open(union trapped_args *args, void *pr_ctxt);
158extern u32 strmwrap_reclaim(union trapped_args *args, void *pr_ctxt);
159extern u32 strmwrap_register_notify(union trapped_args *args, void *pr_ctxt);
160extern u32 strmwrap_select(union trapped_args *args, void *pr_ctxt);
161
162extern u32 cmmwrap_calloc_buf(union trapped_args *args, void *pr_ctxt);
163extern u32 cmmwrap_free_buf(union trapped_args *args, void *pr_ctxt);
164extern u32 cmmwrap_get_handle(union trapped_args *args, void *pr_ctxt);
165extern u32 cmmwrap_get_info(union trapped_args *args, void *pr_ctxt);
166
167#endif /* DSPAPI_ */
168