Skip to content

Commit

Permalink
Change related to upstream merge.
Browse files Browse the repository at this point in the history
* STAND_ALONE conditional compilation is removed.
* Previous interim commits are squashed.
* printk.h is included from atomport.h
* atom-types.h and atommport-types.h have been removed.

Signed-off-by: Himanshu Chauhan <hschauhan@nulltrace.org>
  • Loading branch information
hschauhan committed May 26, 2011
1 parent 8bb70d8 commit f7dde30
Show file tree
Hide file tree
Showing 41 changed files with 29 additions and 242 deletions.
2 changes: 0 additions & 2 deletions kernel/atommutex.c
Expand Up @@ -102,8 +102,6 @@

#ifndef STAND_ALONE
#include <stdio.h>
#else
#include <atom-types.h>
#endif

#include "atom.h"
Expand Down
2 changes: 0 additions & 2 deletions kernel/atomqueue.c
Expand Up @@ -92,8 +92,6 @@

#ifndef STAND_ALONE
#include <stdio.h>
#else
#include <atom-types.h>
#endif

#include <string.h>
Expand Down
4 changes: 0 additions & 4 deletions kernel/atomsem.c
Expand Up @@ -91,10 +91,6 @@
#include <stdio.h>
#endif

#ifdef STAND_ALONE
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomsem.h"
#include "atomtimer.h"
Expand Down
2 changes: 0 additions & 2 deletions kernel/atomtimer.c
Expand Up @@ -68,8 +68,6 @@

#ifndef STAND_ALONE
#include <stdio.h>
#else
#include <atom-types.h>
#endif

#include "atom.h"
Expand Down
11 changes: 2 additions & 9 deletions ports/mips/8250-serial.c
Expand Up @@ -30,14 +30,9 @@
*/

#include <system.h>
#include <atomport-types.h>
#include <stdarg.h>
#include <atomport.h>
#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)
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/atomport-interrupts.c
Expand Up @@ -28,7 +28,7 @@
*/

#include <atomport-asm-macros.h>
#include <atomport-types.h>
#include <atomport.h>
#include <atom.h>

void mips_setup_interrupts()
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/atomport-timer.c
Expand Up @@ -28,7 +28,7 @@
*/

#include <atomport-asm-macros.h>
#include <atomport-types.h>
#include <atomport.h>
#include <atom.h>
#include <atomport-timer.h>

Expand Down
44 changes: 0 additions & 44 deletions ports/mips/atomport-types.h

This file was deleted.

16 changes: 15 additions & 1 deletion ports/mips/atomport.h
Expand Up @@ -30,16 +30,30 @@
#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
* included above.
*/
#define POINTER void *

#include "printk.h"

/* Critical region protection */
#define CRITICAL_STORE unsigned int status_reg
#define CRITICAL_START() \
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/io.c
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <atomport-types.h>
#include <atomport.h>

uint8_t ioreadb (void *addr)
{
Expand Down
5 changes: 1 addition & 4 deletions ports/mips/printk.c
Expand Up @@ -29,14 +29,11 @@
*/

#include <system.h>
#include <atomport-types.h>

#include <atomport.h>
#include <stdarg.h>

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)
{
Expand Down
5 changes: 2 additions & 3 deletions ports/mips/printk.h
Expand Up @@ -33,10 +33,9 @@
#ifndef _PRINTK_H
#define _PRINTK_H

#include <atomport-types.h>
#include <stdarg.h>
#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, ...);

Expand Down
2 changes: 1 addition & 1 deletion ports/mips/string.c
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <atomport-types.h>
#include <atomport.h>
#include <system.h>

void *memcpy(void *dest, const void *src, size_t count)
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/string.h
Expand Up @@ -31,7 +31,7 @@
#ifndef __STRING_H
#define __STRING_H

#include <atomport-types.h>
#include <atomport.h>

void *memcpy(void *dest, const void *src, size_t count);
void *memset(void *dest, int8_t val, size_t count);
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/system.h
Expand Up @@ -31,7 +31,7 @@
#ifndef _SYSTEM_H
#define _SYSTEM_H

#include <atomport-types.h>
#include <atomport.h>
#include <stdarg.h>

extern const uint8_t *kernel_name;
Expand Down
2 changes: 1 addition & 1 deletion ports/mips/tests-main.c
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions 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 <stdarg.h>
#include <system.h>
#include <atomport-types.h>
#include <atomport.h>

/* we use this so that we can do without the ctype library */
#define is_digit(c) ((c) >= '0' && (c) <= '9')
Expand Down
7 changes: 0 additions & 7 deletions tests/mutex4.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomtests.h"
#include "atommutex.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/mutex5.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomtests.h"
#include "atommutex.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/mutex8.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atommutex.h"
#include "atomtests.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/mutex9.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomtests.h"
#include "atommutex.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue10.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue2.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue3.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue5.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomtests.h"
#include "atomqueue.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue6.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
Expand Down
7 changes: 0 additions & 7 deletions tests/queue7.c
Expand Up @@ -27,13 +27,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef STAND_ALONE
#include <stddef.h>
#else
#include <printk.h>
#include <atom-types.h>
#endif

#include "atom.h"
#include "atomqueue.h"
#include "atomtests.h"
Expand Down

0 comments on commit f7dde30

Please sign in to comment.