From ef6024ad7dbf0c7e3b59ad007b03bbce5a6abb3d Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 4 Dec 2020 02:02:55 +0000 Subject: internals: ipc connections: use volatile type for book-keeping variables. --- src/internal/ntapi_impl.h | 6 +++--- src/ipc/ntapi_ipc_connect.c | 6 +++--- src/msq/ntapi_msq_recv.c | 8 ++++---- src/msq/ntapi_msq_send.c | 8 ++++---- src/sem/ntapi_sem_ioctl.c | 8 ++++---- src/sem/ntapi_sem_query.c | 8 ++++---- src/sem/ntapi_sem_set.c | 8 ++++---- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/internal/ntapi_impl.h b/src/internal/ntapi_impl.h index deba32c..f565fff 100644 --- a/src/internal/ntapi_impl.h +++ b/src/internal/ntapi_impl.h @@ -99,9 +99,9 @@ typedef struct __attr_ptr_size_aligned__ _ntapi_internals { 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; + void * volatile ipc_pages[__NT_IPC_PAGES]; + int32_t volatile ipc_page; + intptr_t volatile hlock; uintptr_t v1_pipe_counter; ntapi_tt_get_csr_port_handle_addr_by_logic * tt_get_csr_port_handle_addr_by_logic; __ntapi_img_sec_bss * ntapi_img_sec_bss; diff --git a/src/ipc/ntapi_ipc_connect.c b/src/ipc/ntapi_ipc_connect.c index 16f725e..eacbff2 100644 --- a/src/ipc/ntapi_ipc_connect.c +++ b/src/ipc/ntapi_ipc_connect.c @@ -12,8 +12,8 @@ #include "ntapi_impl.h" static int32_t __ipc_connect_return( - intptr_t * hlock, - int32_t status) + intptr_t volatile * hlock, + int32_t status) { at_store(hlock,0); return status; @@ -300,7 +300,7 @@ static int32_t __ipc_connect_by_attr( const nt_port_attr * conn; nt_port_attr * nconn; nt_ipc_conn * ipc; - intptr_t * hlock; + intptr_t volatile * hlock; nt_rtdata * rtdata; ntapi_internals * __internals; diff --git a/src/msq/ntapi_msq_recv.c b/src/msq/ntapi_msq_recv.c index 8c4a4b0..4ef1784 100644 --- a/src/msq/ntapi_msq_recv.c +++ b/src/msq/ntapi_msq_recv.c @@ -15,9 +15,9 @@ #include "ntapi_impl.h" static int32_t __msq_recv_return( - void * mapaddr, - intptr_t * hlock, - int32_t status) + void * mapaddr, + intptr_t volatile * hlock, + int32_t status) { if (hlock) at_store(hlock,0); @@ -48,7 +48,7 @@ int32_t __stdcall __ntapi_msq_recv( void * secaddr; size_t secsize; nt_msq_info_msg msg; - intptr_t * hlock; + intptr_t volatile * hlock; /* validate */ if (!iosb) diff --git a/src/msq/ntapi_msq_send.c b/src/msq/ntapi_msq_send.c index 53d9f0c..f6ca27f 100644 --- a/src/msq/ntapi_msq_send.c +++ b/src/msq/ntapi_msq_send.c @@ -15,9 +15,9 @@ #include "ntapi_impl.h" static int32_t __msq_send_return( - void * mapaddr, - intptr_t * hlock, - int32_t status) + void * mapaddr, + intptr_t volatile * hlock, + int32_t status) { if (hlock) at_store(hlock,0); @@ -48,7 +48,7 @@ int32_t __stdcall __ntapi_msq_send( void * secaddr; size_t secsize; nt_msq_info_msg msg; - intptr_t * hlock; + intptr_t volatile * hlock; /* validate */ if (!iosb) diff --git a/src/sem/ntapi_sem_ioctl.c b/src/sem/ntapi_sem_ioctl.c index 5c6a0a1..63f0eec 100644 --- a/src/sem/ntapi_sem_ioctl.c +++ b/src/sem/ntapi_sem_ioctl.c @@ -15,9 +15,9 @@ #include "ntapi_impl.h" static int32_t __sem_ioctl_return( - void * mapaddr, - intptr_t * hlock, - int32_t status) + void * mapaddr, + intptr_t volatile * hlock, + int32_t status) { if (hlock) at_store(hlock,0); @@ -49,7 +49,7 @@ int32_t __stdcall __ntapi_sem_ioctl( void * secaddr; size_t secsize; nt_sem_info_msg msg; - intptr_t * hlock; + intptr_t volatile * hlock; (void)output_buffer; (void)output_buffer_length; diff --git a/src/sem/ntapi_sem_query.c b/src/sem/ntapi_sem_query.c index 1a6b2e2..5f1ff6a 100644 --- a/src/sem/ntapi_sem_query.c +++ b/src/sem/ntapi_sem_query.c @@ -15,9 +15,9 @@ #include "ntapi_impl.h" static int32_t __sem_query_return( - void * mapaddr, - intptr_t * hlock, - int32_t status) + void * mapaddr, + intptr_t volatile * hlock, + int32_t status) { if (hlock) at_store(hlock,0); @@ -43,7 +43,7 @@ int32_t __stdcall __ntapi_sem_query( void * secaddr; size_t secsize; nt_sem_info_msg msg; - intptr_t * hlock; + intptr_t volatile * hlock; /* validate */ if (!iosb) diff --git a/src/sem/ntapi_sem_set.c b/src/sem/ntapi_sem_set.c index b8b3ad1..ab42032 100644 --- a/src/sem/ntapi_sem_set.c +++ b/src/sem/ntapi_sem_set.c @@ -15,9 +15,9 @@ #include "ntapi_impl.h" static int32_t __sem_set_return( - void * mapaddr, - intptr_t * hlock, - int32_t status) + void * mapaddr, + intptr_t volatile * hlock, + int32_t status) { if (hlock) at_store(hlock,0); @@ -43,7 +43,7 @@ int32_t __stdcall __ntapi_sem_set( void * secaddr; size_t secsize; nt_sem_info_msg msg; - intptr_t * hlock; + intptr_t volatile * hlock; /* validate */ if (!iosb) -- cgit v1.2.3