aboutsummaryrefslogtreecommitdiff
path: root/PL0_utils.c
blob: 2cede90ec0eae1f153ce55f37b600367406b3822 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <stddef.h>
#include <stdint.h>

#include "svc_interface.h"

// most generic definition possible
// the actual function defined in svc.S
uint32_t svc(enum svc_type, ...);

void putchar(int character)
{
  svc(UART_PUTCHAR, character);
}

int getchar(void)
{
  return svc(UART_GETCHAR);
}

void puts(char *string)
{
  for (size_t i = 0; string[i]; i++)
    putchar(string[i]);

  putchar('\n');
  putchar('\r');
}