diff --git a/kernel/atommutex.c b/kernel/atommutex.c index fdb4fff..6663e6e 100755 --- a/kernel/atommutex.c +++ b/kernel/atommutex.c @@ -102,8 +102,6 @@ #ifndef STAND_ALONE #include -#else -#include #endif #include "atom.h" diff --git a/kernel/atomqueue.c b/kernel/atomqueue.c index 70a65aa..97880a3 100755 --- a/kernel/atomqueue.c +++ b/kernel/atomqueue.c @@ -92,8 +92,6 @@ #ifndef STAND_ALONE #include -#else -#include #endif #include diff --git a/kernel/atomsem.c b/kernel/atomsem.c index d78bccc..8cd0567 100755 --- a/kernel/atomsem.c +++ b/kernel/atomsem.c @@ -91,10 +91,6 @@ #include #endif -#ifdef STAND_ALONE -#include -#endif - #include "atom.h" #include "atomsem.h" #include "atomtimer.h" diff --git a/kernel/atomtimer.c b/kernel/atomtimer.c index 136bf59..cf3a4e7 100755 --- a/kernel/atomtimer.c +++ b/kernel/atomtimer.c @@ -68,8 +68,6 @@ #ifndef STAND_ALONE #include -#else -#include #endif #include "atom.h" diff --git a/ports/mips/8250-serial.c b/ports/mips/8250-serial.c index b1b2227..8d155dd 100644 --- a/ports/mips/8250-serial.c +++ b/ports/mips/8250-serial.c @@ -30,14 +30,9 @@ */ #include -#include -#include +#include #include <8250-serial.h> -//#define PORT1 (void *)0x140003f8 -//#define PORT2 (void *)0x140002F8 -//#define PORT3 (void *)0x140003E8 -//#define PORT4 (void *)0x140002E8 #define PORT1 (void *)0xc00003f8 static inline unsigned int serial_in(int offset) @@ -50,14 +45,12 @@ static inline void serial_out(int offset, int value) iowriteb(PORT1 + offset, value); } -int putch(uint8_t c) +void putch(uint8_t c) { while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) ; serial_out(UART_TX, c); - - return 1; } void init_console() diff --git a/ports/mips/atomport-interrupts.c b/ports/mips/atomport-interrupts.c index 970181f..e0065da 100644 --- a/ports/mips/atomport-interrupts.c +++ b/ports/mips/atomport-interrupts.c @@ -28,7 +28,7 @@ */ #include -#include +#include #include void mips_setup_interrupts() diff --git a/ports/mips/atomport-timer.c b/ports/mips/atomport-timer.c index 9ed1889..0da14aa 100644 --- a/ports/mips/atomport-timer.c +++ b/ports/mips/atomport-timer.c @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include diff --git a/ports/mips/atomport-types.h b/ports/mips/atomport-types.h deleted file mode 100644 index b5c10f9..0000000 --- a/ports/mips/atomport-types.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2011, Himanshu Chauhan. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. No personal names or organizations' names associated with the - * Atomthreads project may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE ATOMTHREADS PROJECT AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __ATOMPORT_TYPES_H -#define __ATOMPORT_TYPES_H - -typedef signed int int32_t; -typedef signed short int16_t; -typedef signed char int8_t; -typedef unsigned int uint32_t; -typedef unsigned short uint16_t; -typedef unsigned char uint8_t; -typedef long long int64_t; -typedef unsigned long size_t; - -#define UINT32 uint32_t - -#endif /* __ATOMPORT_TYPES_H */ diff --git a/ports/mips/atomport.h b/ports/mips/atomport.h index 0df03eb..679cc85 100644 --- a/ports/mips/atomport.h +++ b/ports/mips/atomport.h @@ -30,9 +30,21 @@ #ifndef __ATOM_PORT_H #define __ATOM_PORT_H -#include "atomport-types.h" #include "atomport-timer.h" +typedef signed int int32_t; +typedef signed short int16_t; +typedef signed char int8_t; +typedef unsigned int uint32_t; +typedef unsigned short uint16_t; +typedef unsigned char uint8_t; +typedef long long int64_t; +typedef unsigned long size_t; + +#define UINT32 uint32_t + +#define NULL ((void *)(0)) + /** * Architecture-specific types. * Most of these are available from stdint.h on this platform, which is @@ -40,6 +52,8 @@ */ #define POINTER void * +#include "printk.h" + /* Critical region protection */ #define CRITICAL_STORE unsigned int status_reg #define CRITICAL_START() \ diff --git a/ports/mips/io.c b/ports/mips/io.c index 0ce15c4..90b714c 100644 --- a/ports/mips/io.c +++ b/ports/mips/io.c @@ -28,7 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include uint8_t ioreadb (void *addr) { diff --git a/ports/mips/printk.c b/ports/mips/printk.c index 1ef0f64..c3a38f3 100644 --- a/ports/mips/printk.c +++ b/ports/mips/printk.c @@ -29,14 +29,11 @@ */ #include -#include - +#include #include static int8_t buf[2048]; -extern void putch(uint8_t ch); - /* Uses the above routine to output a string... */ void puts(const uint8_t *text) { diff --git a/ports/mips/printk.h b/ports/mips/printk.h index eeee752..bd1b192 100644 --- a/ports/mips/printk.h +++ b/ports/mips/printk.h @@ -33,10 +33,9 @@ #ifndef _PRINTK_H #define _PRINTK_H -#include -#include +#include "atomport.h" -extern void putch (uint8_t *ch); +extern void putch (uint8_t ch); extern void puts (const uint8_t *text); extern void printk (const char*format, ...); diff --git a/ports/mips/string.c b/ports/mips/string.c index bd65a10..b99b529 100644 --- a/ports/mips/string.c +++ b/ports/mips/string.c @@ -28,7 +28,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include void *memcpy(void *dest, const void *src, size_t count) diff --git a/ports/mips/string.h b/ports/mips/string.h index ed5f98a..bbccc25 100644 --- a/ports/mips/string.h +++ b/ports/mips/string.h @@ -31,7 +31,7 @@ #ifndef __STRING_H #define __STRING_H -#include +#include void *memcpy(void *dest, const void *src, size_t count); void *memset(void *dest, int8_t val, size_t count); diff --git a/ports/mips/system.h b/ports/mips/system.h index c655830..b8c25ad 100644 --- a/ports/mips/system.h +++ b/ports/mips/system.h @@ -31,7 +31,7 @@ #ifndef _SYSTEM_H #define _SYSTEM_H -#include +#include #include extern const uint8_t *kernel_name; diff --git a/ports/mips/tests-main.c b/ports/mips/tests-main.c index 0deb23d..6d7c176 100644 --- a/ports/mips/tests-main.c +++ b/ports/mips/tests-main.c @@ -29,10 +29,10 @@ #include "atom.h" #include "atomport-private.h" +#include "atomport.h" #include "atomtests.h" #include "atomtimer.h" #include "system.h" -#include "printk.h" #include "atomport-interrupts.h" /* Constants */ diff --git a/ports/mips/vsprintf.c b/ports/mips/vsprintf.c index a957676..c8819fd 100644 --- a/ports/mips/vsprintf.c +++ b/ports/mips/vsprintf.c @@ -1,12 +1,12 @@ /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */ /* * Wirzenius wrote this portably, Torvalds fucked it up :-) - * and Himanshu Fucked it up further for Freax :)) + * and Himanshu Fucked it up further :)) */ #include #include -#include +#include /* we use this so that we can do without the ctype library */ #define is_digit(c) ((c) >= '0' && (c) <= '9') diff --git a/tests/mutex4.c b/tests/mutex4.c index 28553fd..cbfc7bf 100644 --- a/tests/mutex4.c +++ b/tests/mutex4.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atommutex.h" diff --git a/tests/mutex5.c b/tests/mutex5.c index c8dff89..a455fce 100644 --- a/tests/mutex5.c +++ b/tests/mutex5.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atommutex.h" diff --git a/tests/mutex8.c b/tests/mutex8.c index fc3e62a..6ea01f0 100644 --- a/tests/mutex8.c +++ b/tests/mutex8.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atommutex.h" #include "atomtests.h" diff --git a/tests/mutex9.c b/tests/mutex9.c index 394e1a7..9e20b97 100644 --- a/tests/mutex9.c +++ b/tests/mutex9.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atommutex.h" diff --git a/tests/queue10.c b/tests/queue10.c index 7a8187c..0a0ff0e 100644 --- a/tests/queue10.c +++ b/tests/queue10.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomqueue.h" #include "atomtests.h" diff --git a/tests/queue2.c b/tests/queue2.c index 0365882..e45a7db 100644 --- a/tests/queue2.c +++ b/tests/queue2.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomqueue.h" #include "atomtests.h" diff --git a/tests/queue3.c b/tests/queue3.c index d2ea0e1..932465a 100644 --- a/tests/queue3.c +++ b/tests/queue3.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomqueue.h" #include "atomtests.h" diff --git a/tests/queue5.c b/tests/queue5.c index e7832cb..6ba450c 100644 --- a/tests/queue5.c +++ b/tests/queue5.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomqueue.h" diff --git a/tests/queue6.c b/tests/queue6.c index c2d3473..b50bc63 100644 --- a/tests/queue6.c +++ b/tests/queue6.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomqueue.h" #include "atomtests.h" diff --git a/tests/queue7.c b/tests/queue7.c index ab77781..e6cca06 100644 --- a/tests/queue7.c +++ b/tests/queue7.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomqueue.h" #include "atomtests.h" diff --git a/tests/queue8.c b/tests/queue8.c index 78921f8..5cfef6d 100644 --- a/tests/queue8.c +++ b/tests/queue8.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomqueue.h" diff --git a/tests/queue9.c b/tests/queue9.c index 78f1132..8091bf4 100644 --- a/tests/queue9.c +++ b/tests/queue9.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomqueue.h" diff --git a/tests/sem3.c b/tests/sem3.c index 113166f..d3d83f7 100644 --- a/tests/sem3.c +++ b/tests/sem3.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem4.c b/tests/sem4.c index 5fb0eb9..64ad00e 100644 --- a/tests/sem4.c +++ b/tests/sem4.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem5.c b/tests/sem5.c index a7e4f6d..3b7daa7 100644 --- a/tests/sem5.c +++ b/tests/sem5.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem6.c b/tests/sem6.c index 106bbfa..f579f8e 100644 --- a/tests/sem6.c +++ b/tests/sem6.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem7.c b/tests/sem7.c index b4595cb..c574e7c 100644 --- a/tests/sem7.c +++ b/tests/sem7.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem8.c b/tests/sem8.c index 75d4896..59ee7a7 100644 --- a/tests/sem8.c +++ b/tests/sem8.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h" #include "atomsem.h" diff --git a/tests/sem9.c b/tests/sem9.c index 48f5249..30fc0a0 100644 --- a/tests/sem9.c +++ b/tests/sem9.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomsem.h" #include "atomtests.h" diff --git a/tests/timer2.c b/tests/timer2.c index b645f0e..883066e 100644 --- a/tests/timer2.c +++ b/tests/timer2.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtimer.h" #include "atomtests.h" diff --git a/tests/timer4.c b/tests/timer4.c index f2864c6..c5c98e6 100644 --- a/tests/timer4.c +++ b/tests/timer4.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtimer.h" #include "atomtests.h" diff --git a/tests/timer5.c b/tests/timer5.c index 080a5b8..231882b 100644 --- a/tests/timer5.c +++ b/tests/timer5.c @@ -27,7 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include "atom.h" #include "atomsem.h" #include "atomtimer.h" diff --git a/tests/timer6.c b/tests/timer6.c index bb50abf..23fa557 100644 --- a/tests/timer6.c +++ b/tests/timer6.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtimer.h" #include "atomtests.h" diff --git a/tests/timer7.c b/tests/timer7.c index 2e10731..7da3b85 100644 --- a/tests/timer7.c +++ b/tests/timer7.c @@ -27,13 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef STAND_ALONE -#include -#else -#include -#include -#endif - #include "atom.h" #include "atomtests.h"