universalisos/microkernel/ports/common/uos_port_armv6m.h
Fábio Coutada 98ed638f3c WIP: emergency commit — ESP32 GDB stub, boot chain work, docs, AGENTS.md rules
All uncommitted work from ESP32 GDB stub development session.
Includes:
- GDB stub (uos_gdbstub.c/.h/_entry.S)
- Startup vector table rewrite
- ESP32 HAL integration files
- Boot chain design docs
- AGENTS.md absolute rules (commit before refactor, no unauthorized changes)
- All prior deepseek session work

This commit prevents further data loss. No claims of correctness.
2026-07-17 01:36:58 +01:00

54 lines
1.8 KiB
C

/*
* UniversalisOS — Cortex-M Port Header (shared constants)
*
* Contains only Cortex-M register definitions and constants.
* NO function implementations — those live in arch/arm/src/port.c.
*/
#ifndef UOS_PORT_ARMV6M_H
#define UOS_PORT_ARMV6M_H
#include "uos_types.h"
#include "uos_compiler.h"
#include "uos_config.h"
#include "uos_arch.h"
/* === Cortex-M System Registers === */
#define UOS_SCB_ICSR (*(volatile uint32_t*)0xE000ED04)
#define UOS_SCB_VTOR (*(volatile uint32_t*)0xE000ED08)
#define UOS_SCB_AIRCR (*(volatile uint32_t*)0xE000ED0C)
#define UOS_SCB_SCR (*(volatile uint32_t*)0xE000ED10)
#define UOS_SCB_CCR (*(volatile uint32_t*)0xE000ED14)
#define UOS_SCB_SHPR2 (*(volatile uint32_t*)0xE000ED1C)
#define UOS_SCB_SHPR3 (*(volatile uint32_t*)0xE000ED20)
/* SysTick */
#define UOS_SYST_CSR (*(volatile uint32_t*)0xE000E010)
#define UOS_SYST_RVR (*(volatile uint32_t*)0xE000E014)
#define UOS_SYST_CVR (*(volatile uint32_t*)0xE000E018)
#define UOS_SYST_CALIB (*(volatile uint32_t*)0xE000E01C)
#define UOS_SYST_CSR_ENABLE (1u << 0)
#define UOS_SYST_CSR_TICKINT (1u << 1)
#define UOS_SYST_CSR_CLKSOURCE (1u << 2)
/* NVIC */
#define UOS_NVIC_ISER (*(volatile uint32_t*)0xE000E100)
#define UOS_NVIC_ICER (*(volatile uint32_t*)0xE000E180)
#define UOS_NVIC_ISPR (*(volatile uint32_t*)0xE000E200)
#define UOS_NVIC_ICPR (*(volatile uint32_t*)0xE000E280)
#define UOS_NVIC_IPR(n) (((volatile uint8_t*)0xE000E400)[(n)])
/* ICSR bits */
#define UOS_ICSR_PENDSVSET (1u << 28)
#define UOS_ICSR_PENDSVCLR (1u << 27)
#define UOS_ICSR_PENDSTSET (1u << 26)
/* Priority defaults */
#ifndef UOS_PENDSV_PRIO
#define UOS_PENDSV_PRIO 0xFF
#endif
#ifndef UOS_SYSTICK_PRIO
#define UOS_SYSTICK_PRIO 0xFE
#endif
#endif /* UOS_PORT_ARMV6M_H */