17 const struct page *pageRO;
26 assert(NULL != pageRW);
27 assert(2 == pageRW->
a);
28 assert(3 == pageRW->
b);
34 assert(NULL != pageRO);
35 assert(2 == pageRO->
a);
36 assert(3 == pageRO->
b);
43 assert(NULL != pageRO);
44 assert(5 == pageRO->
a);
45 assert(3 == pageRO->
b);
49 assert(NULL != pageRW);
50 assert(2 == pageRW->
a);
51 assert(3 == pageRW->
b);
55 assert(5 == pageRW->
a);
56 assert(3 == pageRW->
b);
92 int main(
int argc,
char *argv[])
95 fprintf(stderr,
"Usage: %s test_id\n", argv[0]);
107 fprintf(stderr,
"Invalid test_id: %s \n", argv[1]);
void * hipcPbankGetWritablePage(struct HIPC_pbank *const bank_p)
Gets a current writable page.
int main(int argc, char *argv[])
enum HIPC_errno hipcPbankSwitchRequest(struct HIPC_pbank *const bank_p)
Requests to switch pages.
const void * hipcPbankGetReadOnlyPage(struct HIPC_pbank *const bank_p)
Gets a current read only page.
enum HIPC_pbank_stat hipcPbankGetStat(struct HIPC_pbank *const bank_p)
Gets current status of a bank.
static void test_hipcPbank_err(void)
static void test_hipcPbank(void)
void hipcPbankInit(struct HIPC_pbank *const bank_p, void *const buf_p, const size_t page_size)
Initializes a parameter bank.
size_t hipcPbankGetPageSize(struct HIPC_pbank *const bank_p)
Gets page size.
enum HIPC_errno hipcPbankSwitchComplete(struct HIPC_pbank *const bank_p)
Makes both pages have the same latest contents and completes the switching.
int hipcPbankSwitchAccept(struct HIPC_pbank *const bank_p)
Accepts a switching request and switches pages if switching is requested.