Skip to content

Commit

Permalink
Merge macros.h into common.h
Browse files Browse the repository at this point in the history
  • Loading branch information
tangrs committed May 27, 2013
1 parent c2da7f3 commit 43c5946
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 47 deletions.
1 change: 0 additions & 1 deletion atag.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "atag_tags.h"
#include "atag.h"
#include "common.h"
#include "macros.h"

static void* atag_add(void *head, int tagid, ...) {
va_list ap;
Expand Down
1 change: 0 additions & 1 deletion cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "kernel.h"
#include "common.h"
#include "load.h"
#include "macros.h"
#include "mach.h"
#include "memory.h"
#include "cmd.h"
Expand Down
1 change: 0 additions & 1 deletion common.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/

#include <os.h>
#include "macros.h"
#include "common.h"

#define DUMP(n, s, x) printl( n #x " = 0x%x" NEWLINE, (unsigned)(s.x) );
Expand Down
13 changes: 13 additions & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,23 @@
#define COMMON_H

#include <stddef.h>
#include <nspireio.h>

#define PAGE_SIZE 0x1000
#define DTB_MACH_ID 3503

#define ALIGN(p, size) ((void*)(((unsigned)p + (size - 1)) & ~(size - 1)))
#define ROUND_PAGE_BOUND(x) ((typeof(x))((unsigned)(x)&~(PAGE_SIZE-1)))
#define ROUND_UP_PAGE_BOUND(x) ((typeof(x))((unsigned)(x+PAGE_SIZE-1)&~(PAGE_SIZE-1)))

#define printl(...) do { \
nio_printf(__VA_ARGS__); \
uart_printf(__VA_ARGS__); \
} while(0)


#define NEWLINE "\r\n"

struct params {
struct {
void* addr; /* Where the kernel is loaded (address should be in range of mem_block) */
Expand Down
1 change: 0 additions & 1 deletion fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "fdt.h"
#include "common.h"
#include "macros.h"
#include "memory.h"

static int _fdt_make_node(void * fdt, int parentoffset, const char * name) {
Expand Down
1 change: 0 additions & 1 deletion kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <libfdt.h>

#include "common.h"
#include "macros.h"
#include "atag.h"
#include "fdt.h"

Expand Down
2 changes: 1 addition & 1 deletion load.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <os.h>
#include <libfdt.h>

#include "macros.h"
#include "common.h"
#include "memory.h"

static size_t file_size(const char *filename) {
Expand Down
1 change: 0 additions & 1 deletion mach.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <stdint.h>

#include "common.h"
#include "macros.h"

/*
A conservative approximate of the amount of memory
Expand Down
37 changes: 0 additions & 37 deletions macros.h

This file was deleted.

1 change: 0 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <os.h>
#include <nspireio.h>
#include "common.h"
#include "macros.h"
#include "memory.h"
#include "cmd.h"
#include "mach.h"
Expand Down
1 change: 0 additions & 1 deletion memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <os.h>
#include "common.h"
#include "memory.h"
#include "macros.h"

/* Amount of memory to try extending each time in max_malloc */
#define INC_BLOCK_SIZE 0x10000
Expand Down
1 change: 0 additions & 1 deletion trap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include <os.h>
#include "common.h"
#include "macros.h"


static volatile unsigned * const vectaddr_begin = (volatile unsigned*)0x00000020;
Expand Down

0 comments on commit 43c5946

Please sign in to comment.