diff --git a/sw/snRuntime/src/platforms/standalone/putchar.c b/sw/snRuntime/src/platforms/standalone/putchar.c index eff127f4..be8db6f4 100644 --- a/sw/snRuntime/src/platforms/standalone/putchar.c +++ b/sw/snRuntime/src/platforms/standalone/putchar.c @@ -19,21 +19,19 @@ static volatile struct putc_buffer { // Provide an implementation for putchar. void snrt_putchar(char character) { - if (@HTIF_SERVER@ == 1){ - volatile struct putc_buffer *buf = &putc_buffer[snrt_hartid()]; - buf->data[buf->hdr.size++] = character; - if (buf->hdr.size == PUTC_BUFFER_LEN || character == '\n') { - buf->hdr.syscall_mem[0] = 64; // sys_write - buf->hdr.syscall_mem[1] = 1; // file descriptor (1 = stdout) - buf->hdr.syscall_mem[2] = (uintptr_t)&buf->data; // buffer - buf->hdr.syscall_mem[3] = buf->hdr.size; // length + volatile struct putc_buffer *buf = &putc_buffer[snrt_hartid()]; + buf->data[buf->hdr.size++] = character; + if (buf->hdr.size == PUTC_BUFFER_LEN || character == '\n') { + buf->hdr.syscall_mem[0] = 64; // sys_write + buf->hdr.syscall_mem[1] = 1; // file descriptor (1 = stdout) + buf->hdr.syscall_mem[2] = (uintptr_t)&buf->data; // buffer + buf->hdr.syscall_mem[3] = buf->hdr.size; // length - tohost = (uintptr_t)buf->hdr.syscall_mem; - while (fromhost == 0) - ; - fromhost = 0; + tohost = (uintptr_t)buf->hdr.syscall_mem; + while (fromhost == 0) + ; + fromhost = 0; - buf->hdr.size = 0; - } + buf->hdr.size = 0; } }