/SPARTAN/trunk/include/print.h |
---|
35,11 → 35,11 |
#define INT16 2 |
#define INT32 4 |
static void print_str(char *str); |
static void print_fixed_hex(__native num, int width); |
static void print_number(__native num, int base); |
static void print_str(const char *str); |
static void print_fixed_hex(const __native num, const int width); |
static void print_number(const __native num, const int base); |
extern void putchar(char c); |
extern void printf(char *fmt, ...); |
extern void putchar(const char c); |
extern void printf(const char *fmt, ...); |
#endif |
/SPARTAN/trunk/include/putchar.h |
---|
29,6 → 29,6 |
#ifndef __PUTCHAR_H__ |
#define __PUTCHAR_H__ |
extern void putchar(char ch); |
extern void putchar(const char ch); |
#endif |
/SPARTAN/trunk/src/debug/print.c |
---|
44,7 → 44,7 |
* @param str Characters to print. |
* |
*/ |
void print_str(char *str) |
void print_str(const char *str) |
{ |
int i = 0; |
char c; |
65,7 → 65,7 |
* @param width Count of digits to print. |
* |
*/ |
void print_fixed_hex(__native num, int width) |
void print_fixed_hex(const __native num, const int width) |
{ |
int i; |
84,14 → 84,15 |
* be in range 2 .. 16). |
* |
*/ |
void print_number(__native num, int base) |
{ |
void print_number(const __native num, const int base) |
{ |
int val = num; |
char d[sizeof(__native)*8+1]; /* this is good enough even for base == 2 */ |
int i = sizeof(__native)*8-1; |
do { |
d[i--] = digits[num % base]; |
} while (num /= base); |
d[i--] = digits[val % base]; |
} while (val /= base); |
d[sizeof(__native)*8] = 0; |
print_str(&d[i + 1]); |
132,7 → 133,7 |
* @param fmt Formatting NULL terminated string. |
* |
*/ |
void printf(char *fmt, ...) |
void printf(const char *fmt, ...) |
{ |
int irqpri, i = 0; |
va_list ap; |
/SPARTAN/trunk/arch/ia64/src/putchar.c |
---|
30,7 → 30,7 |
#include <arch/types.h> |
#include <arch/ski/ski.h> |
void putchar(char ch) |
void putchar(const char ch) |
{ |
__asm__ ( |
"mov r15=%0\n" |
/SPARTAN/trunk/arch/mips/src/putchar.c |
---|
32,7 → 32,7 |
#define VIDEORAM 0xA000000 |
void putchar(char ch) |
void putchar(const char ch) |
{ |
__u32 status = cp0_status_read(); |
/SPARTAN/trunk/arch/ia32/include/ega.h |
---|
35,7 → 35,7 |
#define SCREEN (ROW*ROWS) |
extern void ega_init(void); |
extern void ega_putchar(char ch); |
extern void ega_putchar(const char ch); |
static void ega_check_cursor(void); |
static void ega_display_char(char ch); |
/SPARTAN/trunk/arch/ia32/src/drivers/ega.c |
---|
76,7 → 76,7 |
ega_cursor = ega_cursor - ROW; |
} |
void ega_putchar(char ch) |
void ega_putchar(const char ch) |
{ |
pri_t pri; |
110,7 → 110,7 |
outb(0x3d5,ega_cursor&0xff); |
} |
void putchar(char ch) |
void putchar(const char ch) |
{ |
ega_putchar(ch); |
} |