fixed incorrect size of the alib_intvec structure, which misaligned the
authorJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 1 Feb 2021 11:17:48 +0000 (13:17 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Mon, 1 Feb 2021 11:17:48 +0000 (13:17 +0200)
rest of the execbase layout

src/amiga/amigalib.h
src/amiga/mem.c

index 6a12069..f54b2f4 100644 (file)
 struct alib_memchunk {
        struct alib_memchunk *next;
        uint32_t size;
-};
+} __attribute__((packed));
+
+struct alib_intrnode {
+       ALIB_NODE_COMMON(struct alib_intrnode);
+       void *data;
+       void (*code)();
+} __attribute__((packed));
 
 struct alib_memnode {
        ALIB_NODE_COMMON(struct alib_memnode);
@@ -31,13 +37,13 @@ struct alib_memnode {
        struct alib_memchunk *freelist;
        void *start, *end;
        uint32_t freesz;
-};
+} __attribute__((packed));
 
 struct alib_memlist {
        struct alib_memnode *head, *tail, *tailpred;
        uint8_t type;
        uint8_t pad;
-};
+} __attribute__((packed));
 
 struct alib_library {
        ALIB_NODE_COMMON(struct alib_library);
@@ -48,13 +54,13 @@ struct alib_library {
        char *idstr;
        uint32_t csum;
        uint16_t nref;
-};
+} __attribute__((packed));
 
 struct alib_intvec {
        void *data;
        void (*code)();
-       ALIB_NODE_COMMON(struct alib_intvec);
-};
+       struct alib_intrnode *node;
+} __attribute__((packed));
 
 struct alib_execbase {
        struct alib_library lib;
@@ -83,7 +89,7 @@ struct alib_execbase {
 
        struct alib_memlist memlist;
        /* ... more ... */
-};
+} __attribute__((packed));
 
 struct alib_execbase *execbase;
 
index 78db240..d118d5a 100644 (file)
@@ -9,9 +9,7 @@ int init_mem(void)
        struct alib_memnode *mem;
 
        printf("chip memory top: %lx\n", (unsigned long)execbase->chipmem_top);
-
-       printf("memlist head node:\n");
-       memdump(execbase->memlist.head, sizeof(struct alib_memnode));
+       printf("ext memory top: %lx\n", (unsigned long)execbase->extmem_top);
 
        printf("Memory ranges:\n");
        mem = execbase->memlist.head;