4 * DSP-BIOS Bridge driver support functions for TI OMAP processors.
6 * DSP/BIOS Bridge msg_ctrl Module.
8 * Copyright (C) 2005-2006 Texas Instruments, Inc.
10 * This package is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18 #include <linux/types.h>
20 /* ----------------------------------- Host OS */
21 #include <dspbridge/host_os.h>
23 /* ----------------------------------- DSP/BIOS Bridge */
24 #include <dspbridge/dbdefs.h>
26 /* ----------------------------------- Bridge Driver */
27 #include <dspbridge/dspdefs.h>
29 /* ----------------------------------- Platform Manager */
30 #include <dspbridge/dev.h>
32 /* ----------------------------------- This */
34 #include <dspbridge/msg.h>
37 * ======== msg_create ========
39 * Create an object to manage message queues. Only one of these objects
40 * can exist per device object.
42 int msg_create(struct msg_mgr
**msg_man
,
43 struct dev_object
*hdev_obj
, msg_onexit msg_callback
)
45 struct bridge_drv_interface
*intf_fxns
;
46 struct msg_mgr_
*msg_mgr_obj
;
47 struct msg_mgr
*hmsg_mgr
;
52 dev_get_intf_fxns(hdev_obj
, &intf_fxns
);
54 /* Let Bridge message module finish the create: */
56 (*intf_fxns
->msg_create
) (&hmsg_mgr
, hdev_obj
, msg_callback
);
59 /* Fill in DSP API message module's fields of the msg_mgr
61 msg_mgr_obj
= (struct msg_mgr_
*)hmsg_mgr
;
62 msg_mgr_obj
->intf_fxns
= intf_fxns
;
64 /* Finally, return the new message manager handle: */
73 * ======== msg_delete ========
75 * Delete a msg_ctrl manager allocated in msg_create().
77 void msg_delete(struct msg_mgr
*hmsg_mgr
)
79 struct msg_mgr_
*msg_mgr_obj
= (struct msg_mgr_
*)hmsg_mgr
;
80 struct bridge_drv_interface
*intf_fxns
;
83 intf_fxns
= msg_mgr_obj
->intf_fxns
;
85 /* Let Bridge message module destroy the msg_mgr: */
86 (*intf_fxns
->msg_delete
) (hmsg_mgr
);
88 dev_dbg(bridge
, "%s: Error hmsg_mgr handle: %p\n",