summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2020-09-21 13:31:39 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2020-09-21 13:31:39 -0400
commit9932fac52c0cac2e9e0e11c84dfdf99e0a87ebfb (patch)
treeff97b9288293614fefc6f3ed972c3db69cba6f6e /sux.h
parenteea04e3327972f052dcfb8ae0854b77f87d3d52f (diff)
- Fixed some issues with how structs, and unions were
handled. - Added a function called fix_symtree(), which when called. will rearrange the symbol tree based on the order they're declared in by the token stream. The reason I wrote this, was to make sure the symbol tree could be printed correctly. - Optimized print_symtree() to now use tail recursion. - Started adding all of the SuB Suite's structs.
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sux.h b/sux.h
index 2432322..1f87be3 100644
--- a/sux.h
+++ b/sux.h
@@ -54,13 +54,15 @@ extern void io(uint64_t address, uint8_t rw);
extern void init_scr();
-static void *memcopy(void *dst, void *src, unsigned int n) {
+static void *memcopy(void *restrict dst, const void *restrict src, unsigned int n) {
#if copy64
- uint64_t *d = dst, *s = src;
+ uint64_t *d = dst;
+ const uint64_t *s = src;
unsigned int r = n % 8;
n /= 8;
#else
- uint8_t *d = dst, *s = src;
+ uint8_t *d = dst;
+ const uint8_t *s = src;
#endif
for (; n; *d++ = *s++, n--);
#if copy64
@@ -72,6 +74,7 @@ static void *memcopy(void *dst, void *src, unsigned int n) {
return dst;
}
+
static inline uint64_t read_value(struct sux *cpu, uint64_t reg, uint64_t address, uint8_t size, uint8_t inc_clk, uint8_t check_io) {
#if (IO || debug) && !branch
#if keypoll