1
0
mirror of https://github.com/antonblanchard/microwatt.git synced 2026-01-11 23:43:15 +00:00
Benjamin Herrenschmidt e3941109af console: Cleanup console API
Use a more generic console_init() instead of potato_uart_init(),
and do the same for interrupt control. There should be no
change in behaviour.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2020-06-24 09:53:46 +10:00

45 lines
606 B
C

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "console.h"
#define TEST "Test "
#define PASS "PASS\n"
#define FAIL "FAIL\n"
extern long test_addpcis_1(void);
extern long test_addpcis_2(void);
// i < 100
void print_test_number(int i)
{
puts(TEST);
putchar(48 + i/10);
putchar(48 + i%10);
putchar(':');
}
int main(void)
{
int fail = 0;
console_init();
print_test_number(1);
if (test_addpcis_1() != 0) {
fail = 1;
puts(FAIL);
} else
puts(PASS);
print_test_number(2);
if (test_addpcis_2() != 0) {
fail = 1;
puts(FAIL);
} else
puts(PASS);
return fail;
}