X-Git-Url: https://deadsoftware.ru/gitweb?p=cpc.git;a=blobdiff_plain;f=src%2Fnative%2Fposix%2Fgeneric%2FSystem%2FMod%2FKernel.cp;h=2039e1766ff3b0595b81a696846cc72f4dc58c3a;hp=986425d7ce5ae66305c5713c3735afd21afedf72;hb=e01013bb2dfa7aaab246a94bdde530fd91ea4a43;hpb=eac6e7e5c64db525b2174713f730af1883dcc752 diff --git a/src/native/posix/generic/System/Mod/Kernel.cp b/src/native/posix/generic/System/Mod/Kernel.cp index 986425d..2039e17 100644 --- a/src/native/posix/generic/System/Mod/Kernel.cp +++ b/src/native/posix/generic/System/Mod/Kernel.cp @@ -1,9 +1,9 @@ MODULE Kernel; - IMPORT S := SYSTEM, stdlib := C99stdlib, stdio := C99stdio, - time := C99time, wctype := C99wctype, sysmman := C99sys_mman, - dlfcn := C99dlfcn, types := C99types, fcntl := C99fcntl, - unistd := C99unistd, signal := C99signal, setjmp := C99setjmp; + IMPORT S := SYSTEM, stdlib := PosixCstdlib, stdio := PosixCstdio, + time := PosixCtime, wctype := PosixCwctype, sysmman := PosixCsys_mman, + dlfcn := PosixCdlfcn, types := PosixCtypes, fcntl := PosixCfcntl, + unistd := PosixCunistd, signal := PosixCsignal, setjmp := PosixCsetjmp; (* init fpu? *) (* add signal blocking to avoid race conditions in Try/Trap/TrapHandler *) @@ -237,7 +237,9 @@ MODULE Kernel; wouldFinalize: BOOLEAN; - watcher*: PROCEDURE (event: INTEGER); (* for debugging *) + watcher*: PROCEDURE (event: INTEGER); (* for debugging *) + + intTrap*: BOOLEAN; PROCEDURE Erase (adr, words: INTEGER); BEGIN @@ -1566,7 +1568,7 @@ MODULE Kernel; IF isTry THEN setjmp._longjmp(tryEnv, 1) END; - IF err = 128 THEN (* do nothing *) + IF (err = 128) OR (err = 200) & ~intTrap THEN (* do nothing *) ELSIF (trapViewer # NIL) & (restart # NIL) & ~trapped & ~guarded THEN trapped := TRUE; trapViewer() ELSE DefaultTrapViewer @@ -1625,7 +1627,7 @@ MODULE Kernel; IF isTry THEN setjmp._longjmp(tryEnv, 1) END; - IF err = 128 THEN (* do nothing *) + IF (err = 128) OR (err = 200) & ~intTrap THEN (* do nothing *) ELSIF (trapViewer # NIL) & (restart # NIL) & ~trapped & ~guarded THEN trapped := TRUE; trapViewer() ELSE DefaultTrapViewer @@ -1664,6 +1666,7 @@ MODULE Kernel; PROCEDURE Init; VAR i: INTEGER; BEGIN + intTrap := TRUE; pagesize := unistd.sysconf(unistd._SC_PAGESIZE); (* init heap *)