Kernel updates since December 2009

This commit is contained in:
Bahadir Balban
2010-03-25 01:12:40 +02:00
parent 16818191b3
commit 74b5963fcb
487 changed files with 22477 additions and 3857 deletions

View File

@@ -71,9 +71,9 @@ lma_lds = Command(join(BUILDDIR, 'loader/linker.lds'), \
src = Glob('*.[cS]')
objs = env.Object(src)
Depends(src, lma_lds)
Depends(src, loader_ksyms)
Depends(src, loader_image_S)
Depends(objs, lma_lds)
Depends(objs, loader_ksyms)
Depends(objs, loader_image_S)
Depends(objs, join(BUILDDIR, 'conts/containers.elf'))
Depends(objs, join(BUILDDIR, 'kernel.elf'))
Return('objs', 'loader_image_S')

View File

@@ -11,19 +11,19 @@ variant = "baremetal"
config = configuration_retrieve()
arch = config.arch
subarch = config.subarch
gcc_cpu_flag = config.gcc_cpu_flag
gcc_arch_flag = config.gcc_arch_flag
env = Environment(CC = config.kernel_toolchain + 'gcc',
env = Environment(CC = config.toolchain + 'gcc',
# We don't use -nostdinc because sometimes we need standard headers,
# such as stdarg.h e.g. for variable args, as in printk().
CCFLAGS = ['-g', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', \
'-Werror', ('-mcpu=' + gcc_cpu_flag)],
'-Werror', '-march=' + gcc_arch_flag],
LINKFLAGS = ['-nostdlib', '-T' + "include/l4/arch/arm/linker.lds"],
ASFLAGS = ['-D__ASSEMBLY__'],
PROGSUFFIX = '.elf', # The suffix to use for final executable
ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path
LIBS = 'gcc', # libgcc.a - This is required for division routines.
CPPFLAGS = [])
CPPFLAGS = ['-include l4/config.h'])
e = env.Clone()
e.Append(CPPPATH = ['include/sys-' + variant + '/arch-' + arch])

View File

@@ -76,12 +76,35 @@
* The construction, validity and performance of this licence is governed
* by the laws in force in New South Wales, Australia.
*/
#include INC_PLAT(offsets.h)
#include INC_ARCH(scu.h)
#include INC_ARCH(asm.h)
#include INC_ARCH(asm-macros.S)
.section .text
.code 32
.global _start;
.align;
_start:
ldr sp, 1f
#if defined(CONFIG_SMP)
/* In case all cores start executing at _start */
get_cpuid r0
teq r0, #0
beq core0
wfiloop: /* Secondary cores wait here */
mov r0, #0x10000000 /* System Controller base */
orr r0, r0, #0x30
ldr r1, [r0]
teq r1, #0
wfeeq
beq wfiloop
mov pc, r1 /* Jump to the address specified */
#endif
core0:
bl platform_init
bl main
1: .word _stack_top

View File

@@ -111,7 +111,9 @@ typedef __SIZE_TYPE__ size_t;
things such as varargs and printf */
typedef __WCHAR_TYPE__ wchar_t;
#endif
#ifndef NULL
#define NULL ((void *)0)
#endif
#define offsetof(type, member) ((size_t) &((type *)0)->member)
#endif /* _STDDEF_H_ */

View File

@@ -2,20 +2,15 @@
* Ties up platform's uart driver functions with printf
*
* Copyright (C) 2009 B Labs Ltd.
*
*/
#include <stdio.h>
#include <pl011_uart.h>
extern struct pl011_uart uart;
#include <l4/config.h>
#include <libdev/uart.h>
int __fputc(int c, FILE *stream)
{
int res;
do {
res = pl011_tx_char(uart.base, c);
} while( res < 0);
uart_tx_char(uart_print_base, c);
return(0);
return 0;
}

View File

@@ -21,7 +21,7 @@ LIBC_LIBPATH = LIBC_PATH
LIBC_INCPATH = [join(LIBC_PATH, 'include'), \
join(LIBC_PATH, 'include/arch/' + arch)]
env = Environment(CC = config.user_toolchain + 'gcc',
env = Environment(CC = config.toolchain + 'gcc',
CCFLAGS = ['-g', '-nostdinc', '-nostdlib', '-ffreestanding'],
LINKFLAGS = ['-nostdlib'],
ENV = {'PATH' : os.environ['PATH']},