The goal of this sample application is to measure the performance loss when a user thread has to go through a system call compared to a supervisor thread that calls the function directly. Signed-off-by: Nicolas Royer <nroyer@baylibre.com>
21 lines
315 B
C
21 lines
315 B
C
/*
|
|
* Copyright (c) 2020 BayLibre, SAS
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#ifndef MAIN_H
|
|
#define MAIN_H
|
|
|
|
#include <kernel.h>
|
|
|
|
#define csr_read(csr) \
|
|
({ \
|
|
register unsigned long __v; \
|
|
__asm__ volatile ("csrr %0, " #csr \
|
|
: "=r" (__v)); \
|
|
__v; \
|
|
})
|
|
|
|
#endif /* MAIN_H */
|