Skip to content

Commit b7fb4fe

Browse files
WIP improved signal handling in multi-threaded programs
1 parent 597ea44 commit b7fb4fe

File tree

4 files changed

+1508
-1429
lines changed

4 files changed

+1508
-1429
lines changed

src/demon/demon_core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,3 +206,15 @@ dmn_process_read_raw(Arena *arena, DMN_Handle process, Rng1U64 vrange)
206206
}
207207
return buffer;
208208
}
209+
210+
internal String8
211+
dmn_get_trap_inst(void)
212+
{
213+
#if ARCH_X64
214+
local_persist U8 inst[] = { 0xcc };
215+
#else
216+
# error "trap instruction is not defined for this arch"
217+
#endif
218+
return str8_array_fixed(inst);
219+
}
220+

src/demon/demon_core.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ typedef struct DMN_ActiveTrap DMN_ActiveTrap;
142142
struct DMN_ActiveTrap
143143
{
144144
DMN_Trap *trap;
145-
U8 swap_byte;
145+
String8 swap_bytes;
146146
DMN_ActiveTrap *next;
147147
};
148148

@@ -262,4 +262,7 @@ internal void dmn_process_iter_begin(DMN_ProcessIter *iter);
262262
internal B32 dmn_process_iter_next(Arena *arena, DMN_ProcessIter *iter, DMN_ProcessInfo *info_out);
263263
internal void dmn_process_iter_end(DMN_ProcessIter *iter);
264264

265+
//- arch trap
266+
internal String8 dmn_get_trap_inst(void);
267+
265268
#endif // DEMON_CORE_H

0 commit comments

Comments
 (0)