diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-07-15 19:40:55 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-07-24 21:20:13 +0000 |
commit | 092c340a2062fa98b7387fc5fd63578ddae7d0b6 (patch) | |
tree | 98ec96946eeb2ae709cb0528cc6998e21bb9b290 /firmware/test/kernel/main.c | |
parent | 17f7cc92c258bc456a27c3e7c5a19c9409851879 (diff) | |
download | rockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.tar.gz rockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.zip |
[1/4] Remove SH support and all archos targets
This removes all code specific to SH targets
Change-Id: I7980523785d2596e65c06430f4638eec74a06061
Diffstat (limited to 'firmware/test/kernel/main.c')
-rw-r--r-- | firmware/test/kernel/main.c | 104 |
1 files changed, 0 insertions, 104 deletions
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 | |||
26 | void tick_start(unsigned int interval); | ||
27 | |||
28 | unsigned int s1[256]; | ||
29 | unsigned int s2[256]; | ||
30 | |||
31 | void t1(void); | ||
32 | void t2(void); | ||
33 | |||
34 | struct event_queue main_q SHAREDBSS_ATTR; | ||
35 | |||
36 | int tick_add_task(void (*f)(void)); | ||
37 | |||
38 | void testfunc(void) | ||
39 | { | ||
40 | if(current_tick == 5000) | ||
41 | debugf("Yippie!\n"); | ||
42 | } | ||
43 | |||
44 | int 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 | |||
84 | void 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 | |||
96 | void 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 | } | ||