Use 'extern uint8_t' instead of 'extern void' for external symbols.

The beri boot loaders depend on symbols defined in linker scripts or
assembly files.  The boot loaders do not care about the type of these
symbols but just want to extract a pointer to them.  Older versions of
GCC permitted external symbols to be declared of type 'void' and then
'&foo' generated a void pointer to the memory at the symbol's address.
However, void objects are not valid C and newer versions of GCC error if
these are used.  Instead, declare these symbols as being bytes (or
an array of bytes in the cheri_sdcard_vaddr case).

Sponsored by:	DARPA / AFRL
This commit is contained in:
jhb 2018-01-03 17:40:51 +00:00
parent e740008995
commit 6f7c53e69c
2 changed files with 6 additions and 6 deletions

View File

@ -109,10 +109,10 @@
ALTERA_SDCARD_RR1_COMMANDCRCFAILED | ALTERA_SDCARD_RR1_ADDRESSMISALIGNED |\
ALTERA_SDCARD_RR1_ADDRBLOCKRANGE)
extern void __cheri_sdcard_vaddr__;
extern uint8_t __cheri_sdcard_vaddr__[];
#define ALTERA_SDCARD_PTR(type, offset) \
(volatile type *)((uint8_t *)&__cheri_sdcard_vaddr__ + (offset))
(volatile type *)(&__cheri_sdcard_vaddr__[(offset)])
static __inline uint16_t
altera_sdcard_read_uint16(u_int offset)

View File

@ -78,8 +78,8 @@ struct console *consoles[] = {
NULL
};
extern void __bss_start, __bss_end;
extern void __heap_start, __heap_end;
extern uint8_t __bss_start, __bss_end;
extern uint8_t __heap_start, __heap_end;
static int
__elfN(exec)(struct preloaded_file *fp)
@ -108,14 +108,14 @@ main(int argc, char *argv[], char *envv[], struct bootinfo *bootinfop)
struct devsw **dp;
/* NB: Must be sure to bzero() before using any globals. */
bzero(&__bss_start, (uintptr_t)&__bss_end - (uintptr_t)&__bss_start);
bzero(&__bss_start, &__bss_end - &__bss_start);
boot2_argc = argc;
boot2_argv = argv;
boot2_envv = envv;
boot2_bootinfo = *bootinfop; /* Copy rather than by reference. */
setheap((void *)&__heap_start, (void *)&__heap_end);
setheap(&__heap_start, &__heap_end);
/*
* Pick up console settings from boot2; probe console.