build: W600-SDK importiert, Firmware-Build und Hello am EVK

Docker-Build mit gcc-arm-none-eabi 4.9-2014q4 (statt Homebrew-Cask) verwendet,
Dockerfile/tools/docker.sh dafür aus Task 13 vorgezogen. cmake/sdk.cmake schont
gcc 4.9 (kennt -fcommon/-Wno-error=... nicht). Zwei zusätzliche SDK-Stubs
(EarlyInit, pre_gpio_config) in src/sys/sdk_stubs.c ergänzt, siehe sdk/PATCHES.md.
This commit is contained in:
Michael Sauer
2026-09-11 12:52:26 +02:00
parent 4e7ff78fc6
commit 1b0501179d
610 changed files with 224089 additions and 0 deletions
+116
View File
@@ -0,0 +1,116 @@
#ifndef BITOPS_H
#define BITOPS_H
#include "wm_osal.h"
/*
* These functions are the basis of our bit ops.
*
* First, the atomic bitops. These use native endian.
*/
static __inline void set_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
*p |= mask;
tls_os_release_critical(cpu_sr);
}
static __inline void clear_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
*p &= ~mask;
tls_os_release_critical(cpu_sr);
}
static __inline void change_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
*p ^= mask;
tls_os_release_critical(cpu_sr);
}
static __inline int
test_and_set_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned int res;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
res = *p;
*p = res | mask;
tls_os_release_critical(cpu_sr);
return res & mask;
}
static __inline int
test_and_clear_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned int res;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
res = *p;
*p = res & ~mask;
tls_os_release_critical(cpu_sr);
return res & mask;
}
static __inline int
test_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned int res;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
res = *p;
tls_os_release_critical(cpu_sr);
return res & mask;
}
static __inline int
test_and_change_bit(unsigned int bit, volatile unsigned long *p)
{
u32 cpu_sr;
unsigned int res;
unsigned long mask = 1 << (bit & 31);
p += bit >> 5;
cpu_sr = tls_os_set_critical();
res = *p;
*p = res ^ mask;
tls_os_release_critical(cpu_sr);
return res & mask;
}
#endif /* BITOPS_H */