mirror of
https://github.com/drasko/codezero.git
synced 2026-11-27 11:23:54 +01:00
Kernel updates since December 2009
This commit is contained in:
@@ -69,7 +69,7 @@ test_exec_env = environment.Clone()
|
||||
|
||||
test_exec_env.Append(LIBS = ['posix', 'c-userspace'])
|
||||
test_exec_env.Append(LINKFLAGS = '-T' + test_exec_lds[0].path)
|
||||
test_exec_env.Append(CPPFLAGS = ' -D__USERSPACE__')
|
||||
test_exec_env.Append(CPPFLAGS = ' -D__USERSPACE__ -include l4lib/macros.h ')
|
||||
test_exec_env.Replace(PROGSUFFIX = '')
|
||||
test_exec_src = Glob('src/test_exec/*.[cS]')
|
||||
test_exec_objs = test_exec_env.Object(test_exec_src)
|
||||
@@ -81,7 +81,7 @@ AlwaysBuild(test_exec_lds)
|
||||
|
||||
env.Append(LIBS = ['posix', 'c-userspace'])
|
||||
env.Append(LINKFLAGS = '-T' + lma_lds[0].path)
|
||||
env.Append(CPPFLAGS = ' -D__USERSPACE__')
|
||||
env.Append(CPPFLAGS = ' -D__USERSPACE__ -include l4lib/macros.h ')
|
||||
env.Replace(PROGSUFFIX = '')
|
||||
objs = env.Object(src + test_exec_asm)
|
||||
test0 = env.Program('test0', objs)
|
||||
|
||||
@@ -58,7 +58,7 @@ def get_physical_base(source, target, env):
|
||||
prev_image + " >> " + physical_base_ld_script))
|
||||
|
||||
# The kernel build environment
|
||||
env = Environment(CC = config.user_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'],
|
||||
@@ -74,7 +74,7 @@ env = Environment(CC = config.user_toolchain + 'gcc',
|
||||
|
||||
test_exec_ld_script = "include/test_exec_linker.lds"
|
||||
# The kernel build environment:
|
||||
test_exec_env = Environment(CC = config.user_toolchain + 'gcc',
|
||||
test_exec_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 = ['-O3', '-nostdlib', '-ffreestanding', '-std=gnu99', '-Wall', '-Werror'],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define __TEST0_CAP_H__
|
||||
|
||||
|
||||
#include <l4lib/capability.h>
|
||||
#include <l4lib/lib/cap.h>
|
||||
#include <l4/generic/cap-types.h>
|
||||
#include <l4/api/capability.h>
|
||||
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#define __TASKNAME__ "test0"
|
||||
|
||||
#include L4LIB_INC_ARCH(syslib.h)
|
||||
|
||||
// #define TEST_VERBOSE_PRINT
|
||||
#if defined (TEST_VERBOSE_PRINT)
|
||||
#define test_printf(...) printf(__VA_ARGS__)
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/kip.h>
|
||||
#include <l4lib/utcb.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
@@ -15,6 +14,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <atoi.h>
|
||||
#include <stdlib.h>
|
||||
#include L4LIB_INC_ARCH(syslib.h)
|
||||
|
||||
void wait_pager(l4id_t partner)
|
||||
{
|
||||
@@ -50,10 +50,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
shmtest();
|
||||
|
||||
forktest();
|
||||
|
||||
fileio();
|
||||
|
||||
forktest();
|
||||
|
||||
clonetest();
|
||||
|
||||
undeftest();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <capability.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include L4LIB_INC_ARCH(syslib.h)
|
||||
|
||||
int cap_request_pager(struct capability *cap)
|
||||
{
|
||||
|
||||
@@ -26,14 +26,16 @@ int clonetest(void)
|
||||
void *child_stack;
|
||||
|
||||
/* Parent loops and calls clone() to clone new threads. Children don't come back from the clone() call */
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if ((child_stack = mmap(0, 0x1000, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE | MAP_GROWSDOWN, 0, 0)) == MAP_FAILED) {
|
||||
test_printf("MMAP failed.\n");
|
||||
goto out_err;
|
||||
} else {
|
||||
test_printf("Mapped area starting at %p\n", child_stack);
|
||||
}
|
||||
((int *)child_stack)[-1] = 5; /* Test mapped area */
|
||||
// printf("mmap returned child stack: %p\n", child_stack);
|
||||
|
||||
// ((int *)child_stack)[-1] = 5; /* Test mapped area */
|
||||
|
||||
test_printf("Cloning...\n");
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
#include <alloca.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
|
||||
#define PAGE_SIZE 0x1000
|
||||
|
||||
extern char _start_test_exec[];
|
||||
extern char _end_test_exec[];
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Copyright (C) 2007-2009 Bahadir Bilgehan Balban
|
||||
*/
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include <errno.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include <tests.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define PAGE_SIZE 0x1000
|
||||
|
||||
int mmaptest(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
*
|
||||
* Copyright (C) 2007-2009 Bahadir Bilgehan Balban
|
||||
*/
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
#include <l4lib/mutex.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <l4lib/arch/syslib.h>
|
||||
#include <l4lib/kip.h>
|
||||
#include <l4lib/utcb.h>
|
||||
#include <l4lib/ipcdefs.h>
|
||||
|
||||
Reference in New Issue
Block a user