forked from Firmware/Firmwares
adds missing files
This commit is contained in:
parent
eeb17437ee
commit
b082091db2
@ -5,6 +5,7 @@
|
||||
|
||||
extern volatile uint32_t tohost;
|
||||
extern volatile uint32_t fromhost;
|
||||
void write_hex(int fd, uint32_t hex);
|
||||
|
||||
void __wrap__exit(int code)
|
||||
{
|
||||
|
28
bare-metal-bsp/libwrap/sys/puts.c
Normal file
28
bare-metal-bsp/libwrap/sys/puts.c
Normal file
@ -0,0 +1,28 @@
|
||||
/* See LICENSE of license details. */
|
||||
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "platform.h"
|
||||
#include "stub.h"
|
||||
#include "weak_under_alias.h"
|
||||
|
||||
int __wrap_puts(const char *s)
|
||||
{
|
||||
while (*s != '\0') {
|
||||
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
|
||||
UART0_REG(UART_REG_TXFIFO) = *s;
|
||||
|
||||
if (*s == '\n') {
|
||||
while (UART0_REG(UART_REG_TXFIFO) & 0x80000000) ;
|
||||
UART0_REG(UART_REG_TXFIFO) = '\r';
|
||||
}
|
||||
|
||||
++s;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
weak_under_alias(puts);
|
7
bare-metal-bsp/libwrap/sys/weak_under_alias.h
Normal file
7
bare-metal-bsp/libwrap/sys/weak_under_alias.h
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef _BSP_LIBWRAP_WEAK_UNDER_ALIAS_H
|
||||
#define _BSP_LIBWRAP_WEAK_UNDER_ALIAS_H
|
||||
|
||||
#define weak_under_alias(name) \
|
||||
extern __typeof (__wrap_##name) __wrap__##name __attribute__ ((weak, alias ("__wrap_"#name)))
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user