HIPC  0.5
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
pbank.h
Go to the documentation of this file.
1 #ifndef HIPC_PBANK_H
2 #define HIPC_PBANK_H
3 
4 #include <hipc.h>
5 
10 };
11 
12 struct HIPC_pbank {
13  volatile enum HIPC_pbank_stat stat;
14  size_t page_size;
15  void *page_ro_p;
16  void *page_rw_p;
17 };
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23  extern void hipcPbankInit(struct HIPC_pbank *const bank_p,
24  void *const buf_p, const size_t page_size);
25  extern size_t hipcPbankGetPageSize(struct HIPC_pbank *const bank_p);
26  extern const void *hipcPbankGetReadOnlyPage(struct HIPC_pbank *const
27  bank_p);
28  extern void *hipcPbankGetWritablePage(struct HIPC_pbank *const bank_p);
29  extern enum HIPC_pbank_stat
30  hipcPbankGetStat(struct HIPC_pbank *const bank_p);
31  extern enum HIPC_errno
32  hipcPbankSwitchRequest(struct HIPC_pbank *const bank_p);
33  extern int hipcPbankSwitchAccept(struct HIPC_pbank *const bank_p);
34  extern enum HIPC_errno
35  hipcPbankSwitchComplete(struct HIPC_pbank *const bank_p);
36  extern enum HIPC_errno
37  hipcPbankSwitchReqWaitCmpl(struct HIPC_pbank *const bank_p);
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 #endif
enum HIPC_errno hipcPbankSwitchReqWaitCmpl(struct HIPC_pbank *const bank_p)
Calls hipcPbankSwitchRequest(), waits for acceptance of the request, and calls hipcPbankSwitchComplet...
Definition: pbank.c:141
void * hipcPbankGetWritablePage(struct HIPC_pbank *const bank_p)
Gets a current writable page.
Definition: pbank.c:55
size_t page_size
Definition: pbank.h:14
void * page_rw_p
Definition: pbank.h:16
enum HIPC_errno hipcPbankSwitchRequest(struct HIPC_pbank *const bank_p)
Requests to switch pages.
Definition: pbank.c:77
HIPC_pbank_stat
Definition: pbank.h:6
HIPC_errno
Definition: hipc.h:4
const void * hipcPbankGetReadOnlyPage(struct HIPC_pbank *const bank_p)
Gets a current read only page.
Definition: pbank.c:44
enum HIPC_pbank_stat hipcPbankGetStat(struct HIPC_pbank *const bank_p)
Gets current status of a bank.
Definition: pbank.c:66
enum HIPC_pbank_stat stat
Definition: pbank.h:13
void hipcPbankInit(struct HIPC_pbank *const bank_p, void *const buf_p, const size_t page_size)
Initializes a parameter bank.
Definition: pbank.c:14
size_t hipcPbankGetPageSize(struct HIPC_pbank *const bank_p)
Gets page size.
Definition: pbank.c:33
enum HIPC_errno hipcPbankSwitchComplete(struct HIPC_pbank *const bank_p)
Makes both pages have the same latest contents and completes the switching.
Definition: pbank.c:121
int hipcPbankSwitchAccept(struct HIPC_pbank *const bank_p)
Accepts a switching request and switches pages if switching is requested.
Definition: pbank.c:96
void * page_ro_p
Definition: pbank.h:15