remove assembler interface to xprintf()

This commit is contained in:
Markus Fröschle
2016-11-07 10:55:00 +00:00
parent e67057c21e
commit 0ed03ee328
8 changed files with 965 additions and 996 deletions

View File

@@ -21,15 +21,24 @@
#define _BAS_PRINTF_H_
#include <stdarg.h>
#include <stddef.h>
#include "MCF5475.h"
extern void xvsnprintf(char *str, size_t size, const char *fmt, va_list va);
extern void xvprintf(const char *fmt, va_list va);
extern void xprintf(const char *fmt, ...);
extern void xsnprintf(char *str, size_t size, const char *fmt, ...);
extern void xputchar(int c);
extern int sprintf(char *str, const char *format, ...);
extern void display_progress(void);
extern void hexdump(uint8_t buffer[], int size);
static inline void xputchar(int c)
{
while (!(MCF_PSC0_PSCSR & MCF_PSC_PSCSR_TXRDY))
;
MCF_PSC0_PSCTB_8BIT = (uint8_t) c;
}
#endif /* _BAS_PRINTF_H_ */

View File

@@ -22,8 +22,8 @@
* Author: mfro
*/
#ifndef UTIL_H_
#define UTIL_H_
#ifndef _UTIL_H_
#define _UTIL_H_
#include <bas_types.h>
@@ -118,10 +118,10 @@ __extension__ \
#define regsafe_call(addr) \
__extension__ \
({__asm__ volatile ("lea -60(sp),sp\n\t" \
"movem.l d0-d7/a0-a6,(sp)"); \
"movem.l d0-d7/a0-a6,(sp)"); \
((void (*) (void)) addr)(); \
__asm__ volatile ("movem.l (sp),d0-d7/a0-a6\n\t" \
"lea 60(sp),sp"); \
"lea 60(sp),sp"); \
})