Commit f1a95459 authored by GnoStiC's avatar GnoStiC

puae 2.3.1

parent 5928ccfc
...@@ -673,12 +673,14 @@ static uae_u8 ReadCIAA (unsigned int addr) ...@@ -673,12 +673,14 @@ static uae_u8 ReadCIAA (unsigned int addr)
if (notinrom()) if (notinrom())
write_log ("BFE001 R %02X %s\n", tmp, debuginfo(0)); write_log ("BFE001 R %02X %s\n", tmp, debuginfo(0));
#endif #endif
if (inputrecord_debug & 2) { if (inputrecord_debug & 2) {
if (input_record > 0) if (input_record > 0)
inprec_recorddebug_cia (tmp, div10, m68k_getpc ()); inprec_recorddebug_cia (tmp, div10, m68k_getpc ());
else if (input_play > 0) else if (input_play > 0)
inprec_playdebug_cia (tmp, div10, m68k_getpc ()); inprec_playdebug_cia (tmp, div10, m68k_getpc ());
} }
return tmp; return tmp;
case 1: case 1:
#ifdef PARALLEL_PORT #ifdef PARALLEL_PORT
......
...@@ -1693,7 +1693,7 @@ STATIC_INLINE void raw_inc_sp(int off) ...@@ -1693,7 +1693,7 @@ STATIC_INLINE void raw_inc_sp(int off)
static int in_handler=0; static int in_handler=0;
static uae_u8 *veccode; static uae_u8 *veccode;
# ifdef _WIN32 #ifdef _WIN32
#if defined(CPU_64_BIT) #if defined(CPU_64_BIT)
#define ctxPC (pContext->Rip) #define ctxPC (pContext->Rip)
...@@ -1945,7 +1945,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) ...@@ -1945,7 +1945,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except)
#endif #endif
invalidate_block(bi); invalidate_block(bi);
raise_in_cl_list(bi); raise_in_cl_list(bi);
set_special (0); set_special(0);
return EXCEPTION_CONTINUE_EXECUTION; return EXCEPTION_CONTINUE_EXECUTION;
} }
bi=bi->next; bi=bi->next;
...@@ -2359,7 +2359,7 @@ static void ...@@ -2359,7 +2359,7 @@ static void
c->x86_vendor = X86_VENDOR_UNKNOWN; c->x86_vendor = X86_VENDOR_UNKNOWN;
} }
static void cpuid (uae_u32 op, uae_u32 *eax, uae_u32 *ebx, uae_u32 *ecx, uae_u32 *edx) static void cpuid(uae_u32 op, uae_u32 *eax, uae_u32 *ebx, uae_u32 *ecx, uae_u32 *edx)
{ {
const int CPUID_SPACE = 4096; const int CPUID_SPACE = 4096;
uae_u8* cpuid_space = (uae_u8*)cache_alloc(CPUID_SPACE); uae_u8* cpuid_space = (uae_u8*)cache_alloc(CPUID_SPACE);
......
...@@ -1701,7 +1701,7 @@ MIDFUNC(0,live_flags,(void)) ...@@ -1701,7 +1701,7 @@ MIDFUNC(0,live_flags,(void))
} }
MENDFUNC(0,live_flags,(void)) MENDFUNC(0,live_flags,(void))
MIDFUNC(0,dont_care_flags,(void)) MIDFUNC(0,dont_care_flags,(void))
{ {
live.flags_are_important=0; live.flags_are_important=0;
} }
...@@ -1795,7 +1795,7 @@ MENDFUNC(2,bt_l_ri,(R4 r, IMM i)) /* This is defined as only affecting C */ ...@@ -1795,7 +1795,7 @@ MENDFUNC(2,bt_l_ri,(R4 r, IMM i)) /* This is defined as only affecting C */
} }
MENDFUNC(2,bt_l_rr,(R4 r, R4 b)) /* This is defined as only affecting C */ MENDFUNC(2,bt_l_rr,(R4 r, R4 b)) /* This is defined as only affecting C */
MIDFUNC(2,btc_l_ri,(RW4 r, IMM i)) MIDFUNC(2,btc_l_ri,(RW4 r, IMM i))
{ {
int size=4; int size=4;
if (i<16) if (i<16)
...@@ -1831,7 +1831,7 @@ MENDFUNC(2,btc_l_rr,(RW4 r, R4 b)) ...@@ -1831,7 +1831,7 @@ MENDFUNC(2,btc_l_rr,(RW4 r, R4 b))
} }
MENDFUNC(2,btr_l_ri,(RW4 r, IMM i)) MENDFUNC(2,btr_l_ri,(RW4 r, IMM i))
MIDFUNC(2,btr_l_rr,(RW4 r, R4 b)) MIDFUNC(2,btr_l_rr,(RW4 r, R4 b))
{ {
CLOBBER_BT; CLOBBER_BT;
b=readreg(b,4); b=readreg(b,4);
...@@ -1843,7 +1843,7 @@ MIDFUNC(2,btr_l_rr,(RW4 r, R4 b)) ...@@ -1843,7 +1843,7 @@ MIDFUNC(2,btr_l_rr,(RW4 r, R4 b))
MENDFUNC(2,btr_l_rr,(RW4 r, R4 b)) MENDFUNC(2,btr_l_rr,(RW4 r, R4 b))
MIDFUNC(2,bts_l_ri,(RW4 r, IMM i)) MIDFUNC(2,bts_l_ri,(RW4 r, IMM i))
{ {
int size=4; int size=4;
if (i<16) if (i<16)
...@@ -1855,7 +1855,7 @@ MIDFUNC(2,bts_l_ri,(RW4 r, IMM i)) ...@@ -1855,7 +1855,7 @@ MIDFUNC(2,bts_l_ri,(RW4 r, IMM i))
} }
MENDFUNC(2,bts_l_ri,(RW4 r, IMM i)) MENDFUNC(2,bts_l_ri,(RW4 r, IMM i))
MIDFUNC(2,bts_l_rr,(RW4 r, R4 b)) MIDFUNC(2,bts_l_rr,(RW4 r, R4 b))
{ {
CLOBBER_BT; CLOBBER_BT;
b=readreg(b,4); b=readreg(b,4);
......
...@@ -298,13 +298,15 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) ...@@ -298,13 +298,15 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value)
// Z3 P96 RAM // Z3 P96 RAM
p2 = p96ram_start >> 16; p2 = p96ram_start >> 16;
} }
put_word (regs.regs[11] + 0x20, p2); if (value != p2) {
put_word (regs.regs[11] + 0x28, p2); put_word (regs.regs[11] + 0x20, p2);
put_word (regs.regs[11] + 0x28, p2);
}
// -Bernd Roesch // -Bernd Roesch
expamem_hi = p2; expamem_hi = p2;
(*card_map[ecard]) (); (*card_map[ecard]) ();
ecard++; ecard++;
if (p1 != p2) if (value != p2)
write_log (" Card %d remapped %04x0000 -> %04x0000\n", ecard, p1, p2); write_log (" Card %d remapped %04x0000 -> %04x0000\n", ecard, p1, p2);
write_log (" Card %d (Zorro%s) done.\n", ecard, expamem_type () == 0xc0 ? "II" : "III"); write_log (" Card %d (Zorro%s) done.\n", ecard, expamem_type () == 0xc0 ? "II" : "III");
if (ecard < cardno) if (ecard < cardno)
...@@ -982,7 +984,7 @@ static void expamem_init_filesys (void) ...@@ -982,7 +984,7 @@ static void expamem_init_filesys (void)
expamem_write (0x08, no_shutup); expamem_write (0x08, no_shutup);
expamem_write (0x04, 2); expamem_write (0x04, currprefs.maprom ? 2 : 82);
expamem_write (0x10, uae_id >> 8); expamem_write (0x10, uae_id >> 8);
expamem_write (0x14, uae_id & 0xff); expamem_write (0x14, uae_id & 0xff);
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#define f_out fprintf #define f_out fprintf
#define console_out printf #define console_out printf
#ifdef JIT #ifdef JIT
extern uae_u8* compiled_code; //extern uae_u8* compiled_code;
#include "compemu.h" #include "compemu.h"
#else #else
/* Need to have these somewhere */ /* Need to have these somewhere */
......
...@@ -75,25 +75,27 @@ void cache_free (uae_u8 *cache) ...@@ -75,25 +75,27 @@ void cache_free (uae_u8 *cache)
static uae_u32 lowmem (void) static uae_u32 lowmem (void)
{ {
uae_u32 change = 0; uae_u32 change = 0;
if (currprefs.z3fastmem_size + currprefs.z3fastmem2_size >= 8 * 1024 * 1024) { if (currprefs.z3fastmem_size + currprefs.z3fastmem2_size + currprefs.z3chipmem_size >= 8 * 1024 * 1024) {
if (currprefs.z3fastmem2_size) { if (currprefs.z3fastmem2_size) {
if (currprefs.z3fastmem2_size <= 128 * 1024 * 1024) { change = currprefs.z3fastmem2_size;
change = currprefs.z3fastmem2_size; currprefs.z3fastmem2_size = 0;
currprefs.z3fastmem2_size = 0; } else if (currprefs.z3chipmem_size) {
if (currprefs.z3chipmem_size <= 16 * 1024 * 1024) {
change = currprefs.z3chipmem_size;
currprefs.z3chipmem_size = 0;
} else { } else {
change = currprefs.z3fastmem2_size / 2; change = currprefs.z3chipmem_size / 2;
currprefs.z3fastmem2_size >>= 1; currprefs.z3chipmem_size /= 2;
changed_prefs.z3fastmem2_size = currprefs.z3fastmem2_size;
} }
} else { } else {
change = currprefs.z3fastmem_size - currprefs.z3fastmem_size / 4; change = currprefs.z3fastmem_size - currprefs.z3fastmem_size / 4;
currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = currprefs.z3fastmem_size / 4; currprefs.z3fastmem2_size = changed_prefs.z3fastmem2_size = currprefs.z3fastmem_size / 4;
currprefs.z3fastmem_size >>= 1; currprefs.z3fastmem_size /= 2;
changed_prefs.z3fastmem_size = currprefs.z3fastmem_size; changed_prefs.z3fastmem_size = currprefs.z3fastmem_size;
} }
} else if (currprefs.gfxmem_size >= 1 * 1024 * 1024) { } else if (currprefs.gfxmem_size >= 1 * 1024 * 1024) {
change = currprefs.gfxmem_size - currprefs.gfxmem_size / 2; change = currprefs.gfxmem_size - currprefs.gfxmem_size / 2;
currprefs.gfxmem_size >>= 1; currprefs.gfxmem_size /= 2;
changed_prefs.gfxmem_size = currprefs.gfxmem_size; changed_prefs.gfxmem_size = currprefs.gfxmem_size;
} }
if (currprefs.z3fastmem2_size < 128 * 1024 * 1024) if (currprefs.z3fastmem2_size < 128 * 1024 * 1024)
...@@ -158,13 +160,11 @@ void preinit_shm (void) ...@@ -158,13 +160,11 @@ void preinit_shm (void)
} }
write_log ("Max Z3FastRAM %dM. Total physical RAM %u %uM\n", max_z3fastmem >> 20, totalphys64 >> 20, totalphys64 >> 20); write_log ("Max Z3FastRAM %dM. Total physical RAM %u %uM\n", max_z3fastmem >> 20, totalphys64 >> 20, totalphys64 >> 20);
//testwritewatch ();
canbang = 1; canbang = 1;
} }
static void resetmem (void) static void resetmem (void)
{ {
return;
int i; int i;
if (!shm_start) if (!shm_start)
...@@ -190,115 +190,111 @@ return; ...@@ -190,115 +190,111 @@ return;
int init_shm (void) int init_shm (void)
{ {
uae_u32 size, totalsize, z3size, natmemsize, rtgbarrier, rtgextra; uae_u32 size, totalsize, z3size, natmemsize;
int rounds = 0; uae_u32 rtgbarrier, z3chipbarrier, rtgextra;
int rounds = 0;
restart: restart:
for (;;) { for (;;) {
int lowround = 0; int lowround = 0;
uae_u8 *blah = NULL; uae_u8 *blah = NULL;
if (rounds > 0) if (rounds > 0)
write_log ("NATMEM: retrying %d..\n", rounds); write_log ("NATMEM: retrying %d..\n", rounds);
rounds++; rounds++;
if (natmem_offset) if (natmem_offset)
free(natmem_offset); free(natmem_offset);
natmem_offset = NULL; natmem_offset = NULL;
natmem_offset_end = NULL; natmem_offset_end = NULL;
canbang = 0; canbang = 0;
z3size = 0; z3size = 0;
size = 0x1000000; size = 0x1000000;
rtgextra = 0; rtgextra = 0;
rtgbarrier = getpagesize(); z3chipbarrier = 0;
if (currprefs.cpu_model >= 68020) rtgbarrier = getpagesize();
size = 0x10000000; if (currprefs.cpu_model >= 68020)
if (currprefs.z3fastmem_size || currprefs.z3fastmem2_size) { size = 0x10000000;
z3size = currprefs.z3fastmem_size + currprefs.z3fastmem2_size + (currprefs.z3fastmem_start - 0x10000000); if (currprefs.z3fastmem_size || currprefs.z3fastmem2_size || currprefs.z3chipmem_size) {
if (currprefs.gfxmem_size) z3size = currprefs.z3fastmem_size + currprefs.z3fastmem2_size + currprefs.z3chipmem_size + (currprefs.z3fastmem_start - 0x10000000);
rtgbarrier = 16 * 1024 * 1024; if (currprefs.gfxmem_size)
} else { rtgbarrier = 16 * 1024 * 1024;
rtgbarrier = 0; if (currprefs.z3chipmem_size && (currprefs.z3fastmem_size || currprefs.z3fastmem2_size))
} z3chipbarrier = 16 * 1024 * 1024;
totalsize = size + z3size + currprefs.gfxmem_size; } else {
while (totalsize > size64) { rtgbarrier = 0;
int change = lowmem (); }
if (!change) totalsize = size + z3size + currprefs.gfxmem_size;
return 0; while (totalsize > size64) {
write_log ("NATMEM: %d, %dM > %dM = %dM\n", ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20); int change = lowmem ();
totalsize -= change; if (!change)
} return 0;
if ((rounds > 1 && totalsize < 0x10000000) || rounds > 20) { write_log ("NATMEM: %d, %dM > %dM = %dM\n", ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20);
write_log ("NATMEM: No special area could be allocated (3)!\n"); totalsize -= change;
return 0; }
} if ((rounds > 1 && totalsize < 0x10000000) || rounds > 20) {
natmemsize = size + z3size; write_log ("NATMEM: No special area could be allocated (3)!\n");
return 0;
free (memwatchtable); }
memwatchtable = 0; natmemsize = size + z3size;
if (currprefs.gfxmem_size) {
if (!memwatchok) { if (currprefs.gfxmem_size) {
write_log ("GetWriteWatch() not supported, using guard pages, RTG performance will be slower.\n"); rtgextra = getpagesize();
memwatchtable = xcalloc (uae_u8, currprefs.gfxmem_size / getpagesize() + 1); } else {
} rtgbarrier = 0;
} rtgextra = 0;
if (currprefs.gfxmem_size) { }
rtgextra = getpagesize(); size = natmemsize + rtgbarrier + currprefs.gfxmem_size + rtgextra + 16 * getpagesize();
} else { blah = (uae_u8*)valloc (size);
rtgbarrier = 0; mprotect (blah, size, PROT_READ|PROT_WRITE|PROT_EXEC);
rtgextra = 0; if (blah) {
} natmem_offset = blah;
size = natmemsize + rtgbarrier + currprefs.gfxmem_size + rtgextra + 16 * getpagesize(); break;
blah = (uae_u8*)valloc (size); }
mprotect (blah, size, PROT_READ|PROT_WRITE|PROT_EXEC); write_log ("NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n",
natmemsize >> 20, errno, (currprefs.z3fastmem_size + currprefs.z3fastmem2_size + currprefs.z3chipmem_size) >> 20, currprefs.gfxmem_size >> 20);
if (blah) { if (!lowmem ()) {
natmem_offset = blah; write_log ("NATMEM: No special area could be allocated (2)!\n");
break; return 0;
} }
write_log ("NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n", }
natmemsize >> 20, errno, (currprefs.z3fastmem_size + currprefs.z3fastmem2_size) >> 20, currprefs.gfxmem_size >> 20); p96mem_size = currprefs.gfxmem_size;
if (!lowmem ()) { if (p96mem_size) {
write_log ("NATMEM: No special area could be allocated (2)!\n"); free (natmem_offset);
return 0; size = natmemsize + rtgbarrier + z3chipbarrier;
} if (!(natmem_offset = valloc (size))) {
} write_log ("VirtualAlloc() part 2 error %d. RTG disabled.\n", errno);
p96mem_size = currprefs.gfxmem_size; currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
if (p96mem_size) { rtgbarrier = getpagesize();
free (natmem_offset); rtgextra = 0;
size = natmemsize + rtgbarrier; goto restart;
if (!(natmem_offset = valloc (size))) { }
write_log ("VirtualAlloc() part 2 error %d. RTG disabled.\n", errno); mprotect (natmem_offset, size, PROT_READ|PROT_WRITE|PROT_EXEC);
currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0; size = p96mem_size + rtgextra;
rtgbarrier = getpagesize(); p96mem_offset = (uae_u8*)valloc (/*natmem_offset + natmemsize + rtgbarrier,*/ size);
rtgextra = 0; mprotect (p96mem_offset, size, PROT_READ|PROT_WRITE|PROT_EXEC);
goto restart; if (!p96mem_offset) {
} currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0;
mprotect (natmem_offset, size, PROT_READ|PROT_WRITE|PROT_EXEC); write_log ("NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", errno);
size = p96mem_size + rtgextra; }
p96mem_offset = (uae_u8*)valloc (/*natmem_offset + natmemsize + rtgbarrier,*/ size); }
mprotect (p96mem_offset, size, PROT_READ|PROT_WRITE|PROT_EXEC);
if (!p96mem_offset) { if (!natmem_offset) {
currprefs.gfxmem_size = changed_prefs.gfxmem_size = 0; write_log ("NATMEM: No special area could be allocated! (1) err=%d\n", errno);
write_log ("NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", errno); } else {
} write_log ("NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n",
} natmem_offset, (uae_u8*)natmem_offset + natmemsize,
if (!natmem_offset) { natmemsize, natmemsize >> 20);
write_log ("NATMEM: No special area could be allocated! (1) err=%d\n", errno); if (currprefs.gfxmem_size)
} else { write_log ("NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n",
write_log ("NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n", p96mem_offset, (uae_u8*)p96mem_offset + currprefs.gfxmem_size,
natmem_offset, (uae_u8*)natmem_offset + natmemsize, currprefs.gfxmem_size, currprefs.gfxmem_size >> 20);
natmemsize, natmemsize >> 20); canbang = 1;
if (currprefs.gfxmem_size) natmem_offset_end = p96mem_offset + currprefs.gfxmem_size;
write_log ("NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n", }
p96mem_offset, (uae_u8*)p96mem_offset + currprefs.gfxmem_size,
currprefs.gfxmem_size, currprefs.gfxmem_size >> 20); resetmem ();
canbang = 1;
natmem_offset_end = p96mem_offset + currprefs.gfxmem_size; return canbang;
}
resetmem ();
return canbang;
} }
void mapped_free (uae_u8 *mem) void mapped_free (uae_u8 *mem)
...@@ -393,19 +389,24 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg) ...@@ -393,19 +389,24 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg)
got = TRUE; got = TRUE;
} }
if(!_tcscmp (shmids[shmid].name, "z3")) { if(!_tcscmp (shmids[shmid].name, "z3")) {
shmaddr=natmem_offset + currprefs.z3fastmem_start; shmaddr=natmem_offset + z3fastmem_start;
if (!currprefs.z3fastmem2_size) if (!currprefs.z3fastmem2_size)
size += BARRIER; size += BARRIER;
got = TRUE; got = TRUE;
} }
if(!_tcscmp (shmids[shmid].name, "z3_2")) { if(!_tcscmp (shmids[shmid].name, "z3_2")) {
shmaddr=natmem_offset + currprefs.z3fastmem_start + currprefs.z3fastmem_size; shmaddr=natmem_offset + z3fastmem_start + currprefs.z3fastmem_size;
size += BARRIER;
got = TRUE;
}
if(!_tcscmp (shmids[shmid].name, "z3_chip")) {
shmaddr=natmem_offset + z3chipmem_start;
size += BARRIER; size += BARRIER;
got = TRUE; got = TRUE;
} }
if(!_tcscmp (shmids[shmid].name, "gfx")) { if(!_tcscmp (shmids[shmid].name, "gfx")) {
got = TRUE; got = TRUE;
p96special = 1; p96special = TRUE;
p96ram_start = p96mem_offset - natmem_offset; p96ram_start = p96mem_offset - natmem_offset;
shmaddr = natmem_offset + p96ram_start; shmaddr = natmem_offset + p96ram_start;
size += BARRIER; size += BARRIER;
...@@ -499,9 +500,9 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg) ...@@ -499,9 +500,9 @@ void *my_shmat (int shmid, void *shmaddr, int shmflg)
size, size >> 10, errno); size, size >> 10, errno);
} else { } else {
shmids[shmid].attached = result; shmids[shmid].attached = result;
write_log ("VirtualAlloc %08X - %08X %x (%dk) ok%s\n", write_log ("VirtualAlloc %08X - %08X %x (%dk) ok (%08X)%s\n",
(uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
size, size >> 10, p96special ? " P96" : ""); size, size >> 10, shmaddr, p96special ? " P96" : "");
} }
} }
return result; return result;
...@@ -530,6 +531,29 @@ STATIC_INLINE key_t find_shmkey (key_t key) ...@@ -530,6 +531,29 @@ STATIC_INLINE key_t find_shmkey (key_t key)
return result; return result;
} }
int my_shmdt (const void *shmaddr)
{
return 0;
}
int my_shmget (key_t key, size_t size, int shmflg, const char *name)
{
int result = -1;
// write_log ("key %d (%d), size %d, shmflg %d, name %s\n", key, IPC_PRIVATE, size, shmflg, name);
// if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) {
write_log ("shmget of size %d (%dk) for %s\n", size, size >> 10, name);
if ((result = get_next_shmkey ()) != -1) {
shmids[result].size = size;
_tcscpy (shmids[result].name, name);
} else {
result = -1;
}
// }
return result;
}
int my_shmctl (int shmid, int cmd, struct shmid_ds *buf) int my_shmctl (int shmid, int cmd, struct shmid_ds *buf)
{ {
int result = -1; int result = -1;
...@@ -555,28 +579,5 @@ int my_shmctl (int shmid, int cmd, struct shmid_ds *buf) ...@@ -555,28 +579,5 @@ int my_shmctl (int shmid, int cmd, struct shmid_ds *buf)
return result; return result;
} }
int my_shmdt (const void *shmaddr)
{
return 0;
}
int my_shmget (key_t key, size_t size, int shmflg, const char *name)
{
int result = -1;
// write_log ("key %d (%d), size %d, shmflg %d, name %s\n", key, IPC_PRIVATE, size, shmflg, name);
// if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) {
write_log ("shmget of size %d (%dk) for %s\n", size, size >> 10, name);
if ((result = get_next_shmkey ()) != -1) {
shmids[result].size = size;
_tcscpy (shmids[result].name, name);
} else {
result = -1;
}
// }
return result;
}
#endif //NATMEM_OFFSET #endif //NATMEM_OFFSET
#endif //JIT #endif //JIT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment