Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[pandora-kernel.git] / drivers / staging / tidspbridge / include / dspbridge / msg.h
1 /*
2  * msg.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * DSP/BIOS Bridge msg_ctrl Module.
7  *
8  * Copyright (C) 2005-2006 Texas Instruments, Inc.
9  *
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.
13  *
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.
17  */
18
19 #ifndef MSG_
20 #define MSG_
21
22 #include <dspbridge/devdefs.h>
23 #include <dspbridge/msgdefs.h>
24
25 /*
26  *  ======== msg_create ========
27  *  Purpose:
28  *      Create an object to manage message queues. Only one of these objects
29  *      can exist per device object. The msg_ctrl manager must be created before
30  *      the IO Manager.
31  *  Parameters:
32  *      msg_man:            Location to store msg_ctrl manager handle on output.
33  *      hdev_obj:         The device object.
34  *      msg_callback:        Called whenever an RMS_EXIT message is received.
35  *  Returns:
36  *  Requires:
37  *      msg_mod_init(void) called.
38  *      msg_man != NULL.
39  *      hdev_obj != NULL.
40  *      msg_callback != NULL.
41  *  Ensures:
42  */
43 extern int msg_create(struct msg_mgr **msg_man,
44                              struct dev_object *hdev_obj,
45                              msg_onexit msg_callback);
46
47 /*
48  *  ======== msg_delete ========
49  *  Purpose:
50  *      Delete a msg_ctrl manager allocated in msg_create().
51  *  Parameters:
52  *      hmsg_mgr:            Handle returned from msg_create().
53  *  Returns:
54  *  Requires:
55  *      msg_mod_init(void) called.
56  *      Valid hmsg_mgr.
57  *  Ensures:
58  */
59 extern void msg_delete(struct msg_mgr *hmsg_mgr);
60
61 /*
62  *  ======== msg_exit ========
63  *  Purpose:
64  *      Discontinue usage of msg_ctrl module.
65  *  Parameters:
66  *  Returns:
67  *  Requires:
68  *      msg_mod_init(void) successfully called before.
69  *  Ensures:
70  *      Any resources acquired in msg_mod_init(void) will be freed when last
71  *      msg_ctrl client calls msg_exit(void).
72  */
73 extern void msg_exit(void);
74
75 /*
76  *  ======== msg_mod_init ========
77  *  Purpose:
78  *      Initialize the msg_ctrl module.
79  *  Parameters:
80  *  Returns:
81  *      TRUE if initialization succeeded, FALSE otherwise.
82  *  Ensures:
83  */
84 extern bool msg_mod_init(void);
85
86 #endif /* MSG_ */