minor fixes and improvements

This commit is contained in:
Felix Kopp 2021-01-07 19:04:52 +01:00
parent 9c1b546b16
commit 50928211ca
No known key found for this signature in database
GPG key ID: C478BA0A85F75728
3 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@
#include <ardix/atomic.h>
#include <ardix/io.h>
#include <ardix/list.h>
#include <ardix/malloc.h>
#include <ardix/ringbuf.h>
#include <ardix/serial.h>
@ -55,7 +54,6 @@ int arch_serial_init(struct serial_interface *interface)
/* choose the events we want an interrupt on */
REG_UART_IDR = 0xFFFFFFFF; /* make sure all interrupts are disabled first */
REG_UART_IER = REG_UART_IER_RXRDY_MASK
| REG_UART_IER_ENDTX_MASK
| REG_UART_IER_OVRE_MASK
| REG_UART_IER_FRAME_MASK;
@ -129,6 +127,7 @@ void irq_uart(void)
/* REG_UART_PDC_TCR has reached zero */
if (state & REG_UART_SR_ENDTX_MASK) {
/* this might be NULL but that's ok because free() tolerates that */
free(arch_serial_default_interface.tx_current);
/* DMA automatically does this to the actual hardware registers */

View file

@ -36,7 +36,7 @@ struct list_head {
#define list_last_entry(head, type, member) \
container_of((head)->prev, type, member)
#define list_is_empty(head) ((head)->next == head)
#define list_is_empty(head) ((head)->next == (head))
#define list_for_each(head, cursor) \
for (cursor = (head)->next; \

View file

@ -15,13 +15,13 @@
size_t copy_from_user(void *dest, __user const void *src, size_t len)
{
void *tmp = memcpy(dest, src, len);
memcpy(dest, src, len);
return len;
}
size_t copy_to_user(__user void *dest, const void *src, size_t len)
{
void *tmp = memcpy(dest, src, len);
memcpy(dest, src, len);
return len;
}