1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2025-04-21 12:27:27 +03:00

move-kboot.h-to-include.patch

Signed-off-by: Andy Green <andy@openmoko.com>
This commit is contained in:
Andy Green
2008-11-28 10:16:35 +00:00
committed by Andy Green
parent 32cb2fa93c
commit 8cff2ca836
9 changed files with 127 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
#include "ctype.h"
#include <qi-ctype.h>
unsigned char _ctype[] = {
_C,_C,_C,_C,_C,_C,_C,_C, /* 0-7 */

View File

@@ -1,45 +0,0 @@
#define _U 0x01 /* upper */
#define _L 0x02 /* lower */
#define _D 0x04 /* digit */
#define _C 0x08 /* cntrl */
#define _P 0x10 /* punct */
#define _S 0x20 /* white space (space/lf/tab) */
#define _X 0x40 /* hex digit */
#define _SP 0x80 /* hard space (0x20) */
extern unsigned char _ctype[];
#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0)
#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0)
#define iscntrl(c) ((__ismask(c)&(_C)) != 0)
#define isdigit(c) ((__ismask(c)&(_D)) != 0)
#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0)
#define islower(c) ((__ismask(c)&(_L)) != 0)
#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
#define ispunct(c) ((__ismask(c)&(_P)) != 0)
#define isspace(c) ((__ismask(c)&(_S)) != 0)
#define isupper(c) ((__ismask(c)&(_U)) != 0)
#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0)
#define isascii(c) (((unsigned char)(c))<=0x7f)
#define toascii(c) (((unsigned char)(c))&0x7f)
static inline unsigned char __tolower(unsigned char c)
{
if (isupper(c))
c -= 'A'-'a';
return c;
}
static inline unsigned char __toupper(unsigned char c)
{
if (islower(c))
c -= 'a'-'A';
return c;
}
#define tolower(c) __tolower(c)
#define toupper(c) __toupper(c)

View File

@@ -1,37 +0,0 @@
/*
* (C) Copyright 2008 Openmoko, Inc.
* Author: Andy Green <andy@openmoko.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#ifndef __KBOOT_H__
#define __KBOOT_H__
#include <stdarg.h>
#include "serial.h"
#include "ctype.h"
int printk(const char *fmt, ...);
int vsprintf(char *buf, const char *fmt, va_list args);
int puts(const char *string);
void printhex(unsigned char v);
void print32(unsigned int u);
void hexdump(unsigned char *start, int len);
unsigned int _ntohl(unsigned int n);
#endif

View File

@@ -18,8 +18,8 @@
/* NOTE this stuff runs in steppingstone context! */
#include <qi.h>
#include "nand_read.h"
#include "kboot.h"
#define NAND_CMD_READ0 0
#define NAND_CMD_READSTART 0x30

View File

@@ -21,16 +21,12 @@
* MA 02111-1307 USA
*/
#include "kboot.h"
#include <qi.h>
#include <neo_gta02.h>
#include "blink_led.h"
#include <string.h>
#define __ARM__
#include <image.h>
#define u32 unsigned int
#define u16 unsigned short
#define u8 unsigned char
typedef unsigned int uint32_t;
#include <setup.h>
#include "nand_read.h"

View File

@@ -20,8 +20,8 @@
* MA 02111-1307 USA
*/
#include <qi.h>
#include "blink_led.h"
#include "kboot.h"
void serial_init (const int uart)
{

View File

@@ -24,9 +24,9 @@
/* NOTE this stuff runs in steppingstone context! */
#include <qi.h>
#include "blink_led.h"
#include "nand_read.h"
#include "kboot.h"
#include <neo_gta02.h>
#define stringify2(s) stringify1(s)

View File

@@ -20,7 +20,7 @@
* MA 02111-1307 USA
*/
#include "kboot.h"
#include <qi.h>
#include <string.h>
#define DEBUG_CONSOLE_UART UART2