summaryrefslogtreecommitdiffhomepage
path: root/src/internal/ntapi_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/ntapi_impl.h')
-rw-r--r--src/internal/ntapi_impl.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/internal/ntapi_impl.h b/src/internal/ntapi_impl.h
index aca201b..870e5fd 100644
--- a/src/internal/ntapi_impl.h
+++ b/src/internal/ntapi_impl.h
@@ -39,6 +39,10 @@
#ifndef __NT_SYNC_BLOCK_LOCK_TRIES
#define __NT_SYNC_BLOCK_LOCK_TRIES 1024
#endif
+
+#ifndef __NT_IPC_PAGES
+#define __NT_IPC_PAGES 64
+#endif
/* user-defined options: tail */
/* internal page size */
@@ -48,23 +52,27 @@
/* .bss section */
#ifndef __NT_BSS_RESERVED_PAGES
-#define __NT_BSS_RESERVED_PAGES 8
+#define __NT_BSS_RESERVED_PAGES 10
#endif
/* runtime buffers */
#define __NT_BSS_ARGV_BUFFER_SIZE __NT_INTERNAL_PAGE_SIZE * 2
+#define __NT_BSS_IPC_BUFFER_SIZE __NT_INTERNAL_PAGE_SIZE * 2
+
#define __NT_BSS_ARGV_MAX_IDX __NT_BSS_ARGV_BUFFER_SIZE \
/ sizeof(uintptr_t)
#define __NT_BSS_ARGS_BUFFER_SIZE __NT_INTERNAL_PAGE_SIZE \
* __NT_BSS_RESERVED_PAGES \
- - __NT_BSS_ARGV_BUFFER_SIZE
+ - __NT_BSS_ARGV_BUFFER_SIZE \
+ - __NT_BSS_IPC_BUFFER_SIZE
/* ntapi .bss section structure */
typedef struct ___ntapi_img_sec_bss {
wchar16_t * argv_envp_array[__NT_BSS_ARGV_MAX_IDX];
char args_envs_buffer[__NT_BSS_ARGS_BUFFER_SIZE];
+ size_t ipc_buffer[__NT_BSS_IPC_BUFFER_SIZE / sizeof(size_t)];
} __ntapi_img_sec_bss;
@@ -85,6 +93,9 @@ typedef struct __attr_ptr_size_aligned__ _ntapi_internals {
void ** csr_port_handle_addr;
void * hdev_mount_point_mgr;
void * hany[8];
+ struct dalist_ex ipc_conns;
+ void * ipc_pages[__NT_IPC_PAGES];
+ int32_t ipc_page;
intptr_t hlock;
uintptr_t v1_pipe_counter;
ntapi_tt_get_csr_port_handle_addr_by_logic * tt_get_csr_port_handle_addr_by_logic;
@@ -92,6 +103,15 @@ typedef struct __attr_ptr_size_aligned__ _ntapi_internals {
} ntapi_internals;
+/* ipc internals */
+typedef struct _nt_ipc_conn {
+ nt_port_attr attr;
+ void * hsection;
+ void * secaddr;
+ size_t secsize;
+} nt_ipc_conn;
+
+
/* __ntapi_img_sec_data */
typedef struct __attr_ptr_size_aligned__ ___ntapi_img_sec_rdata {
ntapi_hashed_symbol __ntapi_import_table[__NT_IMPORTED_SYMBOLS_ARRAY_SIZE];
@@ -120,6 +140,8 @@ ntapi_internals * __cdecl __ntapi_internals(void);
int32_t __ntapi_tt_open_file_utf8(void ** hfile, void * hat, const char * arg, int fprivate, wchar16_t *, uint32_t);
int32_t __ntapi_tt_open_dir_utf8(void ** hfile, void * hat, const char * arg, int fprivate, wchar16_t *, uint32_t);
+/* ipc internals */
+int __ntapi_ipc_page_alloc(struct dalist_ex * dlist, void ** addr, size_t * alloc_size);
/* debug */
#define __ntidx(x) (&(((ntapi_vtbl *)0)->x)) / sizeof(size_t)