genode/ports-foc/patches/l4lx_genode.patch

939 lines
23 KiB
Diff
Raw Normal View History

2011-12-22 15:19:25 +00:00
Index: arch/l4/kernel/dispatch.c
===================================================================
--- arch/l4/kernel/dispatch.c (revision 23)
+++ arch/l4/kernel/dispatch.c (working copy)
@@ -274,7 +274,7 @@
return 0;
if (l4_msgtag_is_page_fault(tag)) {
- l4x_printf("HYBRID PF!!\n");
+ LOG_printf("HYBRID PF!!\n");
/* No exception IPC, it's a page fault, but shouldn't happen */
goto out_fail;
}
@@ -694,7 +694,7 @@
enter_kdebug("non hybrid in idle?!");
} else {
if (unlikely(l4x_handle_async_event(label, utcb, tag)))
- l4x_printf("Async return with error\n");
+ LOG_printf("Async return with error\n");
}
}
}
Index: arch/l4/kernel/arch-arm/vmlinux.lds.S
===================================================================
--- arch/l4/kernel/arch-arm/vmlinux.lds.S (revision 23)
+++ arch/l4/kernel/arch-arm/vmlinux.lds.S (working copy)
@@ -36,6 +36,12 @@
jiffies = jiffies_64 + 4;
#endif
+PHDRS
+{
+ ro PT_LOAD;
+ rw PT_LOAD;
+}
+
SECTIONS
{
#ifdef CONFIG_XIP_KERNEL
@@ -46,6 +52,19 @@
.init : { /* Init code and data */
_stext = .;
+ _prog_img_beg = .;
+
+ /*
+ * Leave space for parent capability parameters at start of data
+ * section. The protection domain creator is reponsible for storing
+ * sane values here.
+ */
+ _parent_cap = .;
+ _parent_cap_thread_id = .;
+ LONG(0xffffffff);
+ _parent_cap_local_name = .;
+ LONG(0xffffffff);
+
_sinittext = .;
HEAD_TEXT
INIT_TEXT
@@ -80,7 +99,7 @@
INIT_DATA
ARM_EXIT_KEEP(EXIT_DATA)
#endif
- }
+ } : rw
PERCPU_SECTION(32)
@@ -126,6 +145,7 @@
#ifdef CONFIG_MMU
*(.fixup)
#endif
+ *(.text.*) /* put all Genode .text entries in here */
*(.gnu.warning)
*(.rodata)
*(.rodata.*)
@@ -134,8 +154,9 @@
. = ALIGN(4);
*(.got) /* Global offset table */
ARM_CPU_KEEP(PROC_INFO)
- }
+ } : rw
+
RO_DATA(PAGE_SIZE)
#ifdef CONFIG_ARM_UNWIND
@@ -155,6 +176,42 @@
}
#endif
+ /*
+ * When building L4Linux for Genode, the 'CONFIG_ARM_UNWIND' option is
+ * disabled to avoid conflicts between unwinding-related symbols provided
+ * by the Linux kernel and the C++ compiler's libsupc++. Hence, the linker
+ * script section above is not used. Instead, the '.ARM.exidx' entries are
+ * handled as follows (taken from the Genode linker script.
+ */
+ /* .ARM.exidx is sorted, so has to go in its own output section */
+ __exidx_start = .;
+ .ARM.exidx : {
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ }
+ __exidx_end = .;
+
+ .ARM.extab : {
+ *(.ARM.extab*)
+ } : rw
+
+ /* exception frames for C++ */
+ .eh_frame : {
+ __eh_frame_start__ = .;
+ KEEP (*(.eh_frame))
+ LONG(0)
+ } : rw
+
+ .init_array : {
+ __init_array_start = .;
+ _ctors_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+ _ctors_end = .;
+ _dtors_start = .;
+ _dtors_end = .;
+ }
+
_etext = .; /* End of text and rodata section */
#ifdef CONFIG_XIP_KERNEL
@@ -204,8 +261,10 @@
DATA_DATA
CONSTRUCTORS
+ *(.data.*) /* put all Genode .data entries in here */
+
_edata = .;
- }
+ } : rw
_edata_loc = __data_loc + SIZEOF(.data);
#ifdef CONFIG_HAVE_TCM
@@ -267,10 +326,20 @@
NOTES
- BSS_SECTION(0, 0, 0)
+ /* BSS */
+ . = ALIGN(PAGE_SIZE);
+ .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
+ __bss_start = .;
+ *(.bss..page_aligned)
+ *(.bss)
+ *(.bss.*) /* put all Genode .bss entries in here */
+ . = ALIGN(4);
+ __bss_stop = .;
+ }
/* L4: Align to full superpage */
. = ALIGN(1048576);
+ _prog_img_end = .;
_end = .;
/* L4: Add NOTES so that .note.gnu.build-id is caught, because we do
Index: arch/l4/kernel/arch-arm/traps.c
===================================================================
--- arch/l4/kernel/arch-arm/traps.c (revision 23)
+++ arch/l4/kernel/arch-arm/traps.c (working copy)
@@ -66,6 +66,7 @@
dump_mem("", "Exception stack", frame + 4, frame + 4 + sizeof(struct pt_regs));
}
+#if 0
#ifndef CONFIG_ARM_UNWIND
/*
* Stack pointers should always be within the kernels view of
@@ -81,6 +82,7 @@
return 0;
}
#endif
+#endif
/*
* Dump out the contents of some memory nicely...
@@ -170,6 +172,7 @@
#else
static void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk)
{
+#if 0
unsigned int fp, mode;
int ok = 1;
@@ -201,6 +204,7 @@
if (ok)
c_backtrace(fp, mode);
+#endif
}
#endif
Index: arch/l4/kernel/arch-x86/x86_init.c
===================================================================
--- arch/l4/kernel/arch-x86/x86_init.c (revision 23)
+++ arch/l4/kernel/arch-x86/x86_init.c (working copy)
@@ -38,7 +38,7 @@
struct x86_init_ops x86_init __initdata = {
.resources = {
- .probe_roms = probe_roms,
+ .probe_roms = x86_init_noop,
.reserve_resources = reserve_standard_io_resources,
.memory_setup = l4x_memory_setup,
},
Index: arch/l4/kernel/arch-x86/vmlinux.lds.S
===================================================================
--- arch/l4/kernel/arch-x86/vmlinux.lds.S (revision 23)
+++ arch/l4/kernel/arch-x86/vmlinux.lds.S (working copy)
@@ -33,7 +33,7 @@
#ifdef CONFIG_X86_32
OUTPUT_ARCH(i386)
-ENTRY(phys_startup_32)
+ENTRY(_start)
jiffies = jiffies_64;
#else
OUTPUT_ARCH(i386:x86-64)
@@ -67,17 +67,10 @@
#endif
-PHDRS {
- text PT_LOAD FLAGS(5); /* R_E */
- data PT_LOAD FLAGS(6); /* RW_ */
-#ifdef CONFIG_X86_64
- user PT_LOAD FLAGS(5); /* R_E */
-#ifdef CONFIG_SMP
- percpu PT_LOAD FLAGS(6); /* RW_ */
-#endif
- init PT_LOAD FLAGS(7); /* RWE */
-#endif
- note PT_NOTE FLAGS(0); /* ___ */
+PHDRS
+{
+ ro PT_LOAD;
+ rw PT_LOAD;
}
SECTIONS
@@ -97,6 +90,29 @@
/*_stext = .;*/
.text : AT(ADDR(.text) - LOAD_OFFSET) {
_text = .;
+ _prog_img_beg = .;
+
+ /*
+ * Leave space for parent capability parameters at start of data
+ * section. The protection domain creator is reponsible for storing
+ * sane values here.
+ */
+ _parent_cap = .;
+ _parent_cap_thread_id = .;
+ LONG(0xffffffff);
+ _parent_cap_local_name = .;
+ LONG(0xffffffff);
+
+ /*
+ * Platform-specific entry for Fiasco.OC.
+ *
+ * PIC-code compiled for Fiasco.OC, needs some PIC-compatible
+ * way to enter the kernel, the fixed address of the kernel
+ * entry code address needs to be found here.
+ */
+ __l4sys_invoke_indirect = .;
+ LONG(0xeacff000);
+
/* bootstrapping code */
HEAD_TEXT
#ifdef CONFIG_X86_32
@@ -112,14 +128,28 @@
ENTRY_TEXT
IRQENTRY_TEXT
*(.fixup)
+ *(.text.*) /* put all Genode .text entries in here */
*(.gnu.warning)
+
+ . = ALIGN(0x08);
+
+ _ctors_start = .;
+ KEEP (*(.ctors))
+ KEEP (*(SORT(.ctors.*)))
+ KEEP (*(.init_array)) /* list of constructors specific for ARM eabi */
+ _ctors_end = .;
+ _dtors_start = .;
+ KEEP (*(SORT(.dtors.*)))
+ KEEP (*(.dtors))
+ _dtors_end = .;
+
/* End of text section */
_etext = .;
- } :text = 0x9090
+ } : rw
- NOTES :text :note
+ NOTES :rw
- EXCEPTION_TABLE(16) :text = 0x9090
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
#if defined(CONFIG_DEBUG_RODATA)
/* .text should occupy whole number of pages */
@@ -152,10 +182,34 @@
/* rarely changed data like cpu maps */
READ_MOSTLY_DATA(INTERNODE_CACHE_BYTES)
+ *(.data.*) /* put all Genode .data entries in here */
+
+
/* End of data section */
_edata = .;
- } :data
+ } : rw
+ EXCEPTION_TABLE(16) : rw
+
+ /* exception frames for C++ */
+ .eh_frame : {
+ __eh_frame_start__ = .;
+ KEEP (*(.eh_frame))
+ LONG(0)
+ } : rw
+
+ .init_array : {
+ __init_array_start = .;
+ KEEP (*(SORT(.init_array.*)))
+ KEEP (*(.init_array))
+ __init_array_end = .;
+ }
+
+ .gcc_except_table : {
+ KEEP(*(.gcc_except_table))
+ KEEP(*(.gcc_except_table.*))
+ }
+
#ifdef CONFIG_X86_64
#ifdef CONFIG_L4
@@ -366,6 +420,7 @@
__bss_start = .;
*(.bss..page_aligned)
*(.bss)
+ *(.bss.*) /* put all Genode .bss entries in here */
. = ALIGN(PAGE_SIZE);
__bss_stop = .;
}
@@ -378,6 +433,7 @@
__brk_limit = .;
}
+ _prog_img_end = .;
_end = .;
STABS_DEBUG
Index: arch/l4/kernel/head.S
===================================================================
--- arch/l4/kernel/head.S (revision 23)
+++ arch/l4/kernel/head.S (working copy)
@@ -53,6 +53,7 @@
.previous
#endif
+#ifdef NOT_GENODE
#ifdef ARCH_arm
.section ".text"
.globl _start
@@ -82,6 +83,10 @@
__address_l4lx_kinfo:
.long l4lx_kinfo
.previous
+#endif
+#endif /* NOT_GENODE */
+
+#ifdef ARCH_arm
.section .data.head, "wa"
.p2align 12
ENTRY(swapper_pg_dir)
Index: arch/l4/kernel/main.c
===================================================================
--- arch/l4/kernel/main.c (revision 23)
+++ arch/l4/kernel/main.c (working copy)
@@ -305,7 +305,7 @@
}
#endif
-#ifndef CONFIG_L4_SERIAL
+#if 0 //ndef CONFIG_L4_SERIAL
if (strstr(cmdline, "console=ttyLv")) {
LOG_printf("Console output set to ttyLvx but driver not compiled in.\n");
enter_kdebug("L4 serial driver not enabled");
@@ -363,6 +363,11 @@
}
}
+void l4x_irq_save(unsigned long flags) { local_irq_save(flags); }
+void l4x_irq_restore(unsigned long flags) { local_irq_restore(flags); }
+unsigned long l4x_hz(void) { return HZ; }
+int l4x_nr_irqs(void) { return NR_IRQS; }
+
unsigned long l4x_virt_to_phys(volatile void * address)
{
int i;
@@ -375,14 +380,14 @@
+ l4x_phys_virt_addrs[i].phys;
}
- l4x_virt_to_phys_show();
+// l4x_virt_to_phys_show();
/* Whitelist: */
/* Debugging check: don't miss a translation, can give nasty
* DMA problems */
- l4x_printf("%s: Could not translate virt. address %p\n",
+ LOG_printf("%s: Could not translate virt. address %p\n",
__func__, address);
- WARN_ON(1);
+// WARN_ON(1);
return __pa(address);
}
@@ -414,7 +419,7 @@
/* Debugging check: don't miss a translation, can give nasty
* DMA problems */
- l4x_printf("%s: Could not translate phys. address 0x%lx\n",
+ LOG_printf("%s: Could not translate phys. address 0x%lx\n",
__func__, address);
WARN_ON(1);
@@ -532,7 +537,7 @@
r = l4re_ns_query_srv(entry->cap, n + 1, *cap);
if (r) {
- l4x_printf("Failed to query name '%s': %s(%d)\n",
+ LOG_printf("Failed to query name '%s': %s(%d)\n",
name, l4sys_errtostr(r), r);
L4XV_U(f);
return -ENOENT;
@@ -713,6 +718,7 @@
= sizeof(at_exit_functions) / sizeof(at_exit_functions[0]);
static int __current_exititem;
+#if 0
static struct cxa_atexit_item *__next_atexit(void)
{
if (__current_exititem >= at_exit_nr_of_functions) {
@@ -721,21 +727,10 @@
}
return &at_exit_functions[__current_exititem++];
}
+#endif
-int __cxa_atexit(void (*f)(void *), void *arg, void *dso_handle)
-{
- struct cxa_atexit_item *h = __next_atexit();
+extern int __cxa_atexit(void (*f)(void *), void *arg, void *dso_handle);
- if (!h)
- return -1;
-
- h->f = f;
- h->arg = arg;
- h->dso_handle = dso_handle;
-
- return 0;
-}
-
void __cxa_finalize(void *dso_handle)
{
register int i = __current_exititem;
@@ -790,10 +785,20 @@
}
static int l4x_forward_pf(l4_umword_t addr, l4_umword_t pc, int extra_write)
{
+#if 0
l4_msgtag_t tag;
l4_umword_t err;
l4_utcb_t *u = l4_utcb();
+#endif
+ if (!extra_write)
+ l4_touch_ro((void*)l4_trunc_page(addr), L4_LOG2_PAGESIZE);
+ else
+ l4_touch_rw((void*)l4_trunc_page(addr), L4_LOG2_PAGESIZE);
+
+ // TODO: Reenable this part
+#if 0
+
do {
l4_msg_regs_t *mr = l4_utcb_mr_u(u);
mr->mr[0] = addr | (extra_write ? 2 : 0);
@@ -815,6 +820,7 @@
// unresolvable page fault, we're supposed to trigger an
// exception
return 0;
+#endif
return 1;
}
@@ -1054,7 +1060,7 @@
addr = (l4_addr_t)p_in_addr;
size = 1;
if (l4re_rm_find(&addr, &size, &off, &flags, &ds)) {
- LOG_printf("Cannot anything at %p?!", p_in_addr);
+ LOG_printf("Cannot anything at %p\n?!", p_in_addr);
l4re_rm_show_lists();
enter_kdebug("l4re_rm_find failed");
return;
@@ -1254,7 +1260,7 @@
0, "Main memory");
/* Reserve some part of the virtual address space for vmalloc */
- l4x_vmalloc_memory_start = (unsigned long)l4x_main_memory_start;
+ l4x_vmalloc_memory_start = (unsigned long)l4x_main_memory_start + l4x_mainmem_size;
if (l4re_rm_reserve_area(&l4x_vmalloc_memory_start,
#ifdef CONFIG_X86_32
__VMALLOC_RESERVE,
@@ -1381,6 +1387,10 @@
static void l4x_create_ugate(l4_cap_idx_t forthread, unsigned cpu)
{
+ LOG_printf("thread=%lx cpu=%x\n", forthread, cpu);
+ l4x_user_gate[cpu] = forthread;
+
+#if 0
l4_msgtag_t r;
l4x_user_gate[cpu] = l4x_cap_alloc();
@@ -1401,6 +1411,7 @@
l4_debugger_set_object_name(l4x_user_gate[cpu], n);
#endif
}
+#endif
}
#ifdef CONFIG_HOTPLUG_CPU
@@ -1890,8 +1901,10 @@
static int l4x_cpu_virt_phys_map_init(const char *boot_command_line)
{
+#ifdef CONFIG_SMP
l4_umword_t max_cpus = 1;
l4_sched_cpu_set_t cs = l4_sched_cpu_set(0, 0, 0);
+#endif
unsigned i;
#ifdef CONFIG_SMP
@@ -1964,6 +1977,8 @@
#endif
#else /* UP */
+
+#if 0
if (l4_error(l4_scheduler_info(l4re_env()->scheduler,
&max_cpus, &cs)) == L4_EOK) {
@@ -1973,6 +1988,8 @@
l4x_cpu_physmap[0].phys_id = p;
}
#endif
+ l4x_cpu_physmap[0].phys_id = 0;
+#endif
LOG_printf("CPU mapping (l:p)[%d]: ", l4x_nr_cpus);
for (i = 0; i < l4x_nr_cpus; i++)
@@ -2018,6 +2035,7 @@
printk("panic: going to sleep forever, bye\n");
L4XV_L(f);
LOG_printf("panic: going to sleep forever, bye\n");
+ enter_kdebug("PANIC");
l4_sleep_forever();
return 0;
}
@@ -2298,7 +2316,7 @@
}
}
-int __init_refok L4_CV main(int argc, char **argv)
+int __init_refok L4_CV linux_main(int argc, char **argv)
{
l4lx_thread_t main_id;
extern char _end[];
@@ -2410,10 +2428,13 @@
l4x_start_thread_id = l4re_env()->main_thread;
+#if 0
l4_thread_control_start();
l4_thread_control_commit(l4x_start_thread_id);
l4x_start_thread_pager_id
= l4_utcb_mr()->mr[L4_THREAD_CONTROL_MR_IDX_PAGER];
+#endif
+ l4x_start_thread_pager_id = l4re_env()->rm;
#ifndef CONFIG_L4_VCPU
#ifdef CONFIG_L4_TAMED
@@ -3180,6 +3201,10 @@
/* Not resolvable: Ooops */
LOG_printf("Non-resolvable page fault at %lx, ip %lx.\n", pfa, ip);
// will trigger an oops in caller
+
+#ifdef CONFIG_L4_DEBUG_SEGFAULTS
+ enter_kdebug("PF");
+#endif
return 0;
}
@@ -3560,7 +3585,9 @@
void exit(int code)
{
__cxa_finalize(0);
+#if 0
l4x_external_exit(code);
+#endif
LOG_printf("Still alive, going zombie???\n");
l4_sleep_forever();
}
Index: arch/l4/Kconfig
===================================================================
--- arch/l4/Kconfig (revision 23)
+++ arch/l4/Kconfig (working copy)
@@ -394,7 +394,19 @@
config L4_USE_L4SHMC
bool
+config SCREEN_GENODE
+ bool
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
+ default y
+config SERIAL_GENODE
+ bool
+ default y
+ select SERIAL_CORE
+ select SERIAL_CORE_CONSOLE
+
# some delimiter (for .config)
comment ""
source "arch/l4/Kconfig.arch"
Index: arch/l4/include/asm/generic/l4lib.h
===================================================================
--- arch/l4/include/asm/generic/l4lib.h (revision 23)
+++ arch/l4/include/asm/generic/l4lib.h (working copy)
@@ -3,6 +3,7 @@
#include <linux/stringify.h>
+#if 0
#ifdef ARCH_arm
#define L4_EXTERNAL_FUNC(func) \
asm(".section \".data.l4externals.str\" \n" \
@@ -58,5 +59,8 @@
".previous \n" \
)
#endif
+#endif
+#define L4_EXTERNAL_FUNC(func) ;
+
#endif /* __INCLUDE__ASM_L4__GENERIC__L4LIB_H__ */
Index: arch/l4/boot/Makefile
===================================================================
--- arch/l4/boot/Makefile (revision 23)
+++ arch/l4/boot/Makefile (working copy)
@@ -10,7 +10,7 @@
$(call if_changed,objcopy)
@echo ' Kernel: $@ is ready'
-lImage: $(obj)/Image vmlinuz$(VMLINUZ_SUFFIX) l4linux$(VMLINUZ_SUFFIX)
+lImage: $(obj)/Image
vmlinuz$(VMLINUZ_SUFFIX): ldrImage FORCE
$(call if_changed,gzip)
@@ -21,8 +21,8 @@
objects-y := ldr.o res.o image.o
-include $(L4OBJ)/l4defs.mk.inc
-
+#include $(L4OBJ)/l4defs.mk.inc
+KBUILD_CFLAGS_i386 = -m32
KBUILD_CFLAGS := $(filter-out -mregparm=3,$(KBUILD_CFLAGS)) \
$(L4INC) -I$(L4OBJ)/include/uclibc \
-Wall -fno-strict-aliasing -O2 -pipe \
Index: arch/l4/lib/pte.c
===================================================================
--- arch/l4/lib/pte.c (revision 23)
+++ arch/l4/lib/pte.c (working copy)
@@ -19,7 +19,10 @@
#include <l4/sys/task.h>
#include <l4/sys/kdebug.h>
#include <l4/re/consts.h>
+#include <l4/log/log.h>
+extern void l4lx_memory_map_physical_page(unsigned long address);
+
static void l4x_flush_page(struct mm_struct *mm,
unsigned long address,
unsigned long vaddr,
@@ -78,7 +81,7 @@
if (mm && !l4_is_invalid_cap(mm->context.task)) {
L4XV_V(f);
if (!mm->context.task)
- l4x_printf("%s: Ups, task == 0\n", __func__);
+ LOG_printf("%s: Ups, task == 0\n", __func__);
/* Direct flush in the child, use virtual address in the
* child address space */
L4XV_L(f);
@@ -94,10 +97,11 @@
tag = l4_task_unmap(L4RE_THIS_TASK_CAP,
l4_fpage(address & PAGE_MASK, size, flush_rights),
L4_FP_OTHER_SPACES);
+ l4lx_memory_map_physical_page(address);
L4XV_U(f);
}
if (l4_error(tag))
- l4x_printf("l4_task_unmap error %ld\n", l4_error(tag));
+ LOG_printf("l4_task_unmap error %ld\n", l4_error(tag));
}
#ifdef ARCH_arm
Index: arch/l4/Makefile
===================================================================
--- arch/l4/Makefile (revision 23)
+++ arch/l4/Makefile (working copy)
@@ -170,6 +170,12 @@
# prevent gcc from generating any FP code by mistake
KBUILD_CFLAGS += $(call cc-option,-mno-sse -mno-mmx -mno-sse2 -mno-3dnow,)
+#
+# Prevent the gcc from linking Linux memmove into compiler-generated
+# Genode stuff.
+#
+KBUILD_CFLAGS += -Dmemmove=lx_memmove
+
endif
ifeq ($(BASEARCH),arm)
@@ -252,6 +258,8 @@
endif
+# Genode compiler is build without Linux defines.
+KBUILD_CFLAGS +=-D__linux__ -Dlinux
# -----------------------------------------------
@@ -274,14 +282,15 @@
L4LX_E_L-$(CONFIG_L4_TCG_STPM) += stpm-client
L4LX_E_L-$(CONFIG_L4_FERRET) += ferret
-L4INC = -I$(L4OBJ)/include/$(L4_MK_ARCH)/$(L4_MK_API) \
- -I$(L4OBJ)/include/$(L4_MK_ARCH) \
- -I$(L4OBJ)/include/$(L4_MK_API) \
- -I$(L4OBJ)/include
+#L4INC = -I$(L4OBJ)/include/$(L4_MK_ARCH)/$(L4_MK_API) \
+# -I$(L4OBJ)/include/$(L4_MK_ARCH) \
+# -I$(L4OBJ)/include/$(L4_MK_API) \
+# -I$(L4OBJ)/include
head-y := arch/l4/kernel/head.o arch/l4/kernel/init_task.o
-libs-y += arch/l4/lib/arch-$(BASEARCH)/ \
+libs-y += arch/l4/lib/arch-$(BASEARCH)/
+# \
arch/l4/l4lxlib/generic/ \
arch/l4/l4lxlib/$(BASEENV)/
@@ -299,7 +308,7 @@
core-y += arch/l4/
--include $(L4OBJ)/l4defs.mk.inc
+#-include $(L4OBJ)/l4defs.mk.inc
L4_REQUIRED_MODS := libc_be_minimal_log_io \
libc_minimal libc_minimal_l4re \
@@ -315,15 +324,16 @@
$(error Aborting.)
endif
-libs-y += -Bstatic $(L4_LIBDIRS) -ll4sys -ll4sys-direct
+libs-y += $(GENODE_LIBS)
export L4INC L4_REQUIRED_MODS
-LDFLAGS_vmlinux = \
- --defsym __L4_KIP_ADDR__=$(L4_BID_KIP_ADDR) \
- --defsym __l4sys_invoke_direct=$(L4_BID_KIP_ADDR)+$(L4_BID_KIP_OFFS_SYS_INVOKE) \
- --defsym __l4sys_debugger_direct=$(L4_BID_KIP_ADDR)+$(L4_BID_KIP_OFFS_SYS_DEBUGGER)
+LDFLAGS_vmlinux = -nostdlib
+# --defsym __L4_KIP_ADDR__=$(L4_BID_KIP_ADDR) \
+ -nostdlib
+#--defsym __l4sys_invoke_direct=$(L4_BID_KIP_ADDR)+$(L4_BID_KIP_OFFS_SYS_INVOKE) \
+ --defsym __l4sys_debugger_direct=$(L4_BID_KIP_ADDR)+$(L4_BID_KIP_OFFS_SYS_DEBUGGER) \
-KBUILD_CPPFLAGS += -Iarch/l4/include/asm/l4-arch \
+KBUILD_CPPFLAGS += $(GENODE_INCLUDES) -Iarch/l4/include/asm/l4-arch \
-I$(src)/arch/$(LINSRCARCH)/include \
-Iarch/l4/include/asm/$(LINSRCARCH)-arch \
-Iarch/l4/include/asm/orig-arch \
@@ -342,6 +352,8 @@
KBUILD_CPPFLAGS += -DTEXT_OFFSET=0x0100000
endif
+drivers-y += arch/l4/drivers/
+
all: lImage
boot := arch/l4/boot
@@ -350,11 +362,11 @@
$(Q)$(MAKE) $(build)=$(boot) $@
check_for_l4defs:
- $(Q)if [ ! -e $(L4OBJ)/l4defs.mk.inc ]; then \
- echo "No $(L4OBJ)/l4defs.mk.inc available."; \
- echo "Did you run 'make' in $(L4OBJ) to a successful end?"; \
- exit 1; \
- fi
+# $(Q)if [ ! -e $(L4OBJ)/l4defs.mk.inc ]; then \
+# echo "No $(L4OBJ)/l4defs.mk.inc available."; \
+# echo "Did you run 'make' in $(L4OBJ) to a successful end?"; \
+# exit 1; \
+# fi
server:
$(Q)$(MAKE) $(build)=arch/l4/server
Index: include/asm-generic/vmlinux.lds.h
===================================================================
--- include/asm-generic/vmlinux.lds.h (revision 23)
+++ include/asm-generic/vmlinux.lds.h (working copy)
@@ -371,6 +371,7 @@
VMLINUX_SYMBOL(__start___modver) = .; \
*(__modver) \
VMLINUX_SYMBOL(__stop___modver) = .; \
+ LONG(0) /* enforce non-zero section size */ \
. = ALIGN((align)); \
VMLINUX_SYMBOL(__end_rodata) = .; \
} \
Index: drivers/tty/serial/l4ser.c
===================================================================
--- drivers/tty/serial/l4ser.c (revision 23)
+++ drivers/tty/serial/l4ser.c (working copy)
@@ -22,10 +22,12 @@
#include <linux/serial.h>
#include <l4/sys/vcon.h>
+#include <l4/sys/kdebug.h>
#include <l4/sys/factory.h>
#include <l4/sys/icu.h>
#include <l4/re/c/namespace.h>
#include <l4/re/c/util/cap.h>
+#include <l4/log/log.h>
#include <asm/generic/setup.h>
#include <asm/generic/cap_alloc.h>
#include <asm/generic/util.h>
@@ -128,7 +130,10 @@
if (port->x_char) {
L4XV_L(f);
+#if 0
l4_vcon_write(l4port->vcon_cap, &port->x_char, 1);
+#endif
+ LOG_printf("%c", port->x_char);
L4XV_U(f);
port->icount.tx++;
port->x_char = 0;
@@ -140,7 +145,14 @@
if (c > L4_VCON_WRITE_SIZE)
c = L4_VCON_WRITE_SIZE;
L4XV_L(f);
+#if 0
l4_vcon_write(l4port->vcon_cap, &xmit->buf[xmit->tail], c);
+#endif
+ char *ptr = (char*)&xmit->buf[xmit->tail], old = ptr[c];
+ ptr[c] = 0;
+ LOG_printf("%s", ptr);
+ ptr[c] = old;
+
L4XV_U(f);
xmit->tail = (xmit->tail + c) & (UART_XMIT_SIZE - 1);
port->icount.tx += c;
@@ -260,7 +272,7 @@
if (l4ser_port[num].inited)
return 0;
l4ser_port[num].inited = 1;
-
+#if 0
if ((r = l4x_re_resolve_name(name, &l4ser_port[num].vcon_cap))) {
if (num == 0)
l4ser_port[num].vcon_cap = l4re_env()->log;
@@ -301,11 +313,13 @@
L4XV_U(f);
return -EIO;
}
-
+#endif
vcon_attr.i_flags = 0;
vcon_attr.o_flags = 0;
vcon_attr.l_flags = 0;
+#if 0
l4_vcon_set_attr(l4ser_port[num].vcon_cap, &vcon_attr);
+#endif
L4XV_U(f);
l4ser_port[num].port.uartclk = 3686400;
@@ -349,7 +363,14 @@
if (c > L4_VCON_WRITE_SIZE)
c = L4_VCON_WRITE_SIZE;
L4XV_L(f);
+#if 0
l4_vcon_write(l4ser_port[co->index].vcon_cap, s, c);
+#endif
+ char *ptr = (char*)s, old = ptr[c];
+ ptr[c] = 0;
+ LOG_printf("%s", ptr);
+ ptr[c] = old;
+
L4XV_U(f);
count -= c;
} while (count);
@@ -396,6 +417,7 @@
int ret, i;
printk(KERN_INFO "L4 serial driver\n");
+ LOG_printf("L4 serial driver\n");
if (l4ser_init_port(0, PORT0_NAME))
return -ENODEV;