blob: 199c02ad0de124c6110f20e0dd15ba93783619ae [file] [log] [blame]
/*
* Copyright 2017, Data61
* Commonwealth Scientific and Industrial Research Organisation (CSIRO)
* ABN 41 687 119 230.
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(DATA61_BSD)
*/
#pragma once
#include <autoconf.h>
#include <sel4muslcsys/gen_config.h>
#include <stddef.h>
/*
* Each architecture implements the following simple putchar function, usually
* setup to output to serial.
*/
void __arch_putchar(int c) __attribute__((noinline));
size_t __arch_write(char *data, size_t count) __attribute__((noinline));
/*
* Each architecture implements the following simple getchar function, usually
* setup to receive from serial.
*/
int __arch_getchar(void);
typedef size_t (*write_buf_fn)(void *data, size_t count);
/*
* Register a function to be called when sys_writev is called on either
* stdout or stderr. This will return the existing function that is registered.
* Calling this function with NULL is valid and will result in no function being
* called, but writev still returning the number of characters written. This is
* similar to piping to /dev/null.
*/
write_buf_fn sel4muslcsys_register_stdio_write_fn(write_buf_fn write_fn);