From 85895feeaf88bcde26bbfc71e8f6b2047c0f5f41 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Thu, 9 Sep 2021 22:49:00 +0200 Subject: New upstream version 2.5.0~rc6+repack --- map65/libm65/ipcomm.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 map65/libm65/ipcomm.cpp (limited to 'map65/libm65/ipcomm.cpp') diff --git a/map65/libm65/ipcomm.cpp b/map65/libm65/ipcomm.cpp new file mode 100644 index 00000000..b40a0999 --- /dev/null +++ b/map65/libm65/ipcomm.cpp @@ -0,0 +1,34 @@ +#include +#include +#include + +QSharedMemory mem_m65("mem_m65"); +QSystemSemaphore sem_m65("sem_m65", 1, QSystemSemaphore::Open); + +extern "C" { + bool attach_m65_(); + bool create_m65_(int nsize); + bool detach_m65_(); + bool lock_m65_(); + bool unlock_m65_(); + char* address_m65_(); + int size_m65_(); + + bool acquire_m65_(); + bool release_m65_(); + + extern struct { + char c[10]; + } m65com_; +} + +bool attach_m65_() {return mem_m65.attach();} +bool create_m65_(int nsize) {return mem_m65.create(nsize);} +bool detach_m65_() {return mem_m65.detach();} +bool lock_m65_() {return mem_m65.lock();} +bool unlock_m65_() {return mem_m65.unlock();} +char* address_m65_() {return (char*)mem_m65.constData();} +int size_m65_() {return (int)mem_m65.size();} + +bool acquire_m65_() {return sem_m65.acquire();} +bool release_m65_() {return sem_m65.release();} -- cgit v1.2.3