--- src/util.c | 9 +++++++++ src/util.h | 1 + 2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/util.c b/src/util.c index 8e02d1e..f9a7533 100644 --- a/src/util.c +++ b/src/util.c @@ -150,6 +150,15 @@ memset(void *s, int c, size_t n) return s; }
+void memset_fl(void *ptr, u8 val, size_t size) +{ + if (MODESEGMENT) + memset_far(FLATPTR_TO_SEG(ptr), (void*)(FLATPTR_TO_OFFSET(ptr)), + val, size); + else + memset(ptr, val, size); +} + inline void memcpy_far(u16 d_seg, void *d_far, u16 s_seg, const void *s_far, size_t len) { diff --git a/src/util.h b/src/util.h index e513e84..fa7b20f 100644 --- a/src/util.h +++ b/src/util.h @@ -198,6 +198,7 @@ int strcmp(const char *s1, const char *s2); inline void memset_far(u16 d_seg, void *d_far, u8 c, size_t len); inline void memset16_far(u16 d_seg, void *d_far, u16 c, size_t len); void *memset(void *s, int c, size_t n); +void memset_fl(void *ptr, u8 val, size_t size); inline void memcpy_far(u16 d_seg, void *d_far , u16 s_seg, const void *s_far, size_t len); void memcpy_fl(void *d_fl, const void *s_fl, size_t len);