PowerBlocks SDK
 
Loading...
Searching...
No Matches
ipc.h
Go to the documentation of this file.
1
12
13#pragma once
14
15#include <stdint.h>
16
17typedef void (*ipc_async_handler_t)(void* param, int return_value);
18
19typedef struct {
20 int command;
21 int returned;
22 int file_handle;
23
24 union
25 {
26 struct {
27 const char* path;
28 int mode;
29 } open;
30
31 struct {
32 void* address;
33 int size;
34 } read;
35
36 struct {
37 void* address;
38 int size;
39 } write;
40
41 struct {
42 int where;
43 int whence;
44 } seek;
45
46 struct {
47 int ioctl;
48
49 void* address_in;
50 int size_in;
51
52 void* address_io;
53 int size_io;
54 } ioctl;
55
56 struct {
57 int ioctl;
58 int argcin;
59 int argcio;
60 void* pairs;
61 } ioctlv;
62
63 uint32_t args[5];
64 };
65
66 // Used to prevent spurious responses, since this is cleared after the response is used.
67 // Since not doing this could lead to stale stack usage.
68 uint32_t magic;
69
70 ipc_async_handler_t response_handler;
71 void* params;
72
74
85extern void ipc_initialize();
86
98extern int ipc_request(ipc_message* message, ipc_async_handler_t handler, void* params);
void ipc_initialize()
Initializes the IPC Interface.
Definition ipc.c:82
int ipc_request(ipc_message *message, ipc_async_handler_t handler, void *params)
Puts a request in and gets the response.
Definition ipc.c:94
Definition ipc.h:19