# HG changeset patch # User windel # Date 1321223050 -3600 # Node ID 607898120eb1d6b96b2a742ceca5c4e6e804f2bd # Parent 2feec49e6d0a3f01c7a0e39d7dfeb3b1e5c8a399 Work on error in stdarg diff -r 2feec49e6d0a -r 607898120eb1 cos/Makefile --- a/cos/Makefile Sun Nov 13 12:49:13 2011 +0100 +++ b/cos/Makefile Sun Nov 13 23:24:10 2011 +0100 @@ -2,7 +2,7 @@ all: lcfosc.elf -bootdisk: lcfosc.elf grub/menu.lst +bootdisk.img: lcfosc.elf grub/menu.lst objcopy -O binary lcfosc.elf lcfosc.bin cp grub/emptybootdisk.img bootdisk.img mcopy -D o -i bootdisk.img lcfosc.bin :: diff -r 2feec49e6d0a -r 607898120eb1 cos/include/stdarg.h --- a/cos/include/stdarg.h Sun Nov 13 12:49:13 2011 +0100 +++ b/cos/include/stdarg.h Sun Nov 13 23:24:10 2011 +0100 @@ -24,16 +24,18 @@ typedef char *va_list; +// In a 64 bits kernel we are using 64 bits pointers: +#define STACKITEM long + /* Amount of space required in an argument list for an arg of type TYPE. TYPE may alternatively be an expression whose type is used. */ #define __va_rounded_size(TYPE) \ - (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + (((sizeof (TYPE) + sizeof (STACKITEM) - 1) / sizeof (STACKITEM)) * sizeof (STACKITEM)) #define va_start(AP, LASTARG) \ (AP = ((char *) &(LASTARG) + __va_rounded_size(LASTARG))) -extern void va_end (va_list); #define va_end(AP) /* Nothing */ #define va_arg(AP, TYPE) (AP += __va_rounded_size (TYPE), \