When NEWLIB_LIBC=y, building the hwinfo drivers fails with:
In file included from ZEPHYR_ROOT/drivers/hwinfo/hwinfo_weak_impl.c:7:0:
ZEPHYR_ROOT/include/hwinfo.h:43:1: error: unknown type name '__syscall';
did you mean '__fastcall'?
__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length);
^~~~~~~~~
__fastcall
ZEPHYR_ROOT/include/hwinfo.h:43:19: error: expected '=', ',', ';', 'asm'
or '__attribute__' before 'hwinfo_get_device_id'
__syscall ssize_t hwinfo_get_device_id(u8_t *buffer, size_t length);
^~~~~~~~~~~~~~~~~~~~
ZEPHYR_ROOT/drivers/hwinfo/hwinfo_weak_impl.c:9:16: error: expected '=',
',', ';', 'asm' or '__attribute__' before '_impl_hwinfo_get_device_id'
ssize_t __weak _impl_hwinfo_get_device_id(u8_t *buffer, size_t length)
^~~~~~~~~~~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
The <hwinfo.h> file uses __syscall and this symbols is defined by
<kernel.h>. This doesn't happen with the real drivers as they include
<device.h> and thus <kernel.h>.
Fix that by including <kernel.h> from <hwinfo.h>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit adds a new hardware info API.
With this API it is possible to read out the device ID.
Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>