41 lines
724 B
C
41 lines
724 B
C
|
// This is NEW CODE replacing the old printf with one based on my libc
|
||
|
#ifndef _KPRINTF_H
|
||
|
#define _KPRINTF_H
|
||
|
|
||
|
#ifndef NULL
|
||
|
#define NULL ((void*)0ULL)
|
||
|
#endif
|
||
|
|
||
|
#ifdef _ZCC
|
||
|
#include "cc_stdarg.h"
|
||
|
#else
|
||
|
#include <stdarg.h>
|
||
|
#endif
|
||
|
|
||
|
#define EOF ((int)-1)
|
||
|
typedef unsigned long uintptr_t;
|
||
|
|
||
|
#ifdef _ZCC
|
||
|
#define _LIBC_PRINTF_CALLCONV __classic_call
|
||
|
#else
|
||
|
#define _LIBC_PRINTF_CALLCONV
|
||
|
#endif
|
||
|
|
||
|
extern volatile int kprintf_inpanic;
|
||
|
|
||
|
#ifdef _ZCC
|
||
|
void kprintf_panic(const char* reason);
|
||
|
#else
|
||
|
void kprintf_panic(const char* reason) __attribute__((noreturn));
|
||
|
#endif
|
||
|
|
||
|
int _LIBC_PRINTF_CALLCONV kprintf(const char* fmt, ...);
|
||
|
|
||
|
void kprintf_init();
|
||
|
|
||
|
#define printf kprintf
|
||
|
#define panic kprintf_panic
|
||
|
|
||
|
// From ifndef at top of file:
|
||
|
#endif
|