summaryrefslogtreecommitdiff
path: root/firmware/test/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/test/kernel')
-rw-r--r--firmware/test/kernel/Makefile52
-rw-r--r--firmware/test/kernel/app.lds36
-rw-r--r--firmware/test/kernel/main.c104
3 files changed, 0 insertions, 192 deletions
diff --git a/firmware/test/kernel/Makefile b/firmware/test/kernel/Makefile
deleted file mode 100644
index 94171767c6..0000000000
--- a/firmware/test/kernel/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
1CC = sh-elf-gcc
2LD = sh-elf-ld
3AR = sh-elf-ar
4AS = sh-elf-as
5OC = sh-elf-objcopy
6
7INCLUDES=-I../../ -I../../drivers
8
9# Pick a target to build for
10#TARGET = -DARCHOS_PLAYER=1
11TARGET = -DARCHOS_PLAYER_OLD=1
12#TARGET = -DARCHOS_RECORDER=1
13
14CFLAGS = -g -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG
15AFLAGS += -small -relax
16
17OBJS= ../../crt0.o ../../system.o main.o ../../panic.o ../../drivers/lcd.o \
18 thread.o ../../kernel.o ../../drivers/led.o \
19 ../../debug.o ../../common/sprintf.o
20
21%.o: %.S
22 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) $(ASMFLAGS) -c $<
23
24
25all : archos.mod
26
27archos.elf : $(OBJS) app.lds
28 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map
29
30archos.bin : archos.elf
31 $(OC) -O binary archos.elf archos.bin
32
33archos.asm: archos.bin
34 sh2d -sh1 archos.bin > archos.asm
35
36archos.mod : archos.bin
37 scramble archos.bin archos.mod
38
39archos.mod.gz : archos.mod
40 gzip -f archos.mod
41
42dist:
43 tar czvf dist.tar.gz Makefile main.c start.s app.lds
44
45clean:
46 -rm -f $(OBJS) *.s *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
47
48install:
49 mount /mnt/archos; cp archos.mod /mnt/archos; umount /mnt/archos
50
51thread.o: ../../thread.c
52 $(CC) -O -fomit-frame-pointer -c $(CFLAGS) $<
diff --git a/firmware/test/kernel/app.lds b/firmware/test/kernel/app.lds
deleted file mode 100644
index b8a341a8ae..0000000000
--- a/firmware/test/kernel/app.lds
+++ /dev/null
@@ -1,36 +0,0 @@
1ENTRY(start)
2OUTPUT_FORMAT(elf32-sh)
3SECTIONS
4{
5 .text 0x09010000 :
6 {
7 KEEP(*(.vectors))
8 . = ALIGN(0x200);
9 *(.init.text)
10 }
11
12 .text :
13 {
14 *(.text)
15 }
16
17 .data :
18 {
19 *(.rodata)
20 *(.data)
21 }
22
23 .rodata :
24 {
25 *(.rodata)
26 }
27
28 .bss :
29 {
30 _edata = .;
31 *(.bss)
32 *(COMMON)
33 _end = .;
34 _stack = . + 0x80000;
35 }
36}
diff --git a/firmware/test/kernel/main.c b/firmware/test/kernel/main.c
deleted file mode 100644
index df0e72156a..0000000000
--- a/firmware/test/kernel/main.c
+++ /dev/null
@@ -1,104 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "thread.h"
22#include "kernel.h"
23#include "sh7034.h"
24#include "debug.h"
25
26void tick_start(unsigned int interval);
27
28unsigned int s1[256];
29unsigned int s2[256];
30
31void t1(void);
32void t2(void);
33
34struct event_queue main_q SHAREDBSS_ATTR;
35
36int tick_add_task(void (*f)(void));
37
38void testfunc(void)
39{
40 if(current_tick == 5000)
41 debugf("Yippie!\n");
42}
43
44int main(void)
45{
46 char buf[40];
47 char str[32];
48 int i=0;
49 struct queue_event *ev;
50
51 /* Clear it all! */
52 SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
53
54 /* This enables the serial Rx interrupt, to be able to exit into the
55 debugger when you hit CTRL-C */
56 SCR1 |= 0x40;
57 SCR1 &= ~0x80;
58 IPRE |= 0xf000; /* Set to highest priority */
59
60 debugf("OK. Let's go\n");
61
62 kernel_init();
63
64 enable_irq();
65
66 tick_add_task(testfunc);
67
68 debugf("sleeping 10s...\n");
69 sleep(HZ*10);
70 debugf("woke up\n");
71
72 queue_init(&main_q);
73
74 create_thread(t1, s1, 1024, 0);
75 create_thread(t2, s2, 1024, 0);
76
77 while(1)
78 {
79 ev = queue_wait(&main_q);
80 debugf("Thread 0 got an event. ID: %d\n", ev->id);
81 }
82}
83
84void t1(void)
85{
86 debugf("Thread 1 started\n");
87 while(1)
88 {
89 sleep(HZ);
90 debugf("Thread 1 posting an event\n");
91 queue_post(&main_q, 1234, 0);
92 queue_post(&main_q, 5678, 0);
93 }
94}
95
96void t2(void)
97{
98 debugf("Thread 2 started\n");
99 while(1)
100 {
101 sleep(HZ*3);
102 debugf("Thread 2 awakened\n");
103 }
104}