Skip to content

Size optimize#39

Open
AlexLanzano wants to merge 5 commits into
wolfSSL:mainfrom
AlexLanzano:size-optimize
Open

Size optimize#39
AlexLanzano wants to merge 5 commits into
wolfSSL:mainfrom
AlexLanzano:size-optimize

Conversation

@AlexLanzano
Copy link
Copy Markdown
Member

No description provided.

@AlexLanzano AlexLanzano self-assigned this May 11, 2026
Copilot AI review requested due to automatic review settings May 11, 2026 21:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces code/data footprint by simplifying how wolfHAL models peripheral register access: device handles now store only a peripheral base address (instead of a base+size regmap struct), and some register-access helpers are moved out of headers to reduce per-translation-unit codegen.

Changes:

  • Replace whal_Regmap usage in multiple device handle structs with a single base field (size_t).
  • Remove the whal_Regmap struct from wolfHAL/regmap.h and make whal_Reg_ReadPoll() a non-inline function.
  • Update platform convenience macros from *_REGMAP designated initializers to *_BASE constants.

Reviewed changes

Copilot reviewed 155 out of 155 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
wolfHAL/watchdog/watchdog.h Watchdog handle switched from regmap to base; header include trimmed.
wolfHAL/watchdog/stm32wb_iwdg.h Adds timeout.h include needed by the driver config.
wolfHAL/uart/uart.h UART handle switched from regmap to base; header include trimmed.
wolfHAL/timer/timer.h Timer handle switched from regmap to base; header include trimmed.
wolfHAL/spi/spi.h SPI handle switched from regmap to base; header include trimmed.
wolfHAL/rng/rng.h RNG handle switched from regmap to base; header include trimmed.
wolfHAL/regmap.h Removes whal_Regmap type; whal_Reg_ReadPoll() moved out of the header.
wolfHAL/power/power.h Power handle switched from regmap to base; replaces regmap include with <stddef.h>.
wolfHAL/power/pic32cz_supc.h Adds error.h include to support whal_Error return type.
wolfHAL/platform/st/stm32wba55cg.h Converts platform macros to *_BASE constants; retains most *_DRIVER macros but not for AES/HASH.
wolfHAL/platform/st/stm32wb55xx.h Converts platform macros to *_BASE constants; updates AES driver macro naming.
wolfHAL/platform/st/stm32n657a0.h Converts platform macros to *_BASE constants; CRYP/HASH driver macros are missing.
wolfHAL/platform/st/stm32l152re.h Converts platform macros to *_BASE constants.
wolfHAL/platform/st/stm32h563xx.h Converts platform macros to *_BASE constants.
wolfHAL/platform/st/stm32f411xx.h Converts platform macros to *_BASE constants.
wolfHAL/platform/st/stm32f302r8.h Converts platform macros to *_BASE constants (diff hunk truncated in prompt).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfHAL/uart/uart.h
Comment on lines 33 to +37
/*
* @brief UART device instance tying a register map and driver.
*/
struct whal_Uart {
const whal_Regmap regmap;
const size_t base;
Comment thread wolfHAL/spi/spi.h
Comment on lines 51 to +55
/*
* @brief SPI device instance tying a register map and driver.
*/
struct whal_Spi {
const whal_Regmap regmap;
const size_t base;
Comment thread wolfHAL/rng/rng.h
Comment on lines 27 to +31
/*
* @brief RNG device instance tying a register map and driver.
*/
struct whal_Rng {
const whal_Regmap regmap;
const size_t base;
Comment on lines 32 to +36
/*
* @brief Watchdog device instance tying a register map and driver.
*/
struct whal_Watchdog {
const whal_Regmap regmap;
const size_t base;
Comment on lines +66 to +71
#define WHAL_STM32WBA55_GPDMA1_BASE 0x40020000
#define WHAL_STM32WBA55_GPDMA1_DRIVER &whal_Stm32wba_Gpdma_Driver

#define WHAL_STM32WBA55_AES_REGMAP \
.base = 0x420C0000, \
.size = 0x400
#define WHAL_STM32WBA55_AES_DRIVER &whal_Stm32wba_Aes_Driver
#define WHAL_STM32WBA55_AES_BASE 0x420C0000

#define WHAL_STM32WBA55_HASH_REGMAP \
.base = 0x420C0400, \
.size = 0x400
#define WHAL_STM32WBA55_HASH_DRIVER &whal_Stm32wba_Hash_Driver
#define WHAL_STM32WBA55_HASH_BASE 0x420C0400
Comment on lines +67 to +72
#define WHAL_STM32N657_RNG_BASE 0x44020000
#define WHAL_STM32N657_RNG_DRIVER &whal_Stm32n6_Rng_Driver

#define WHAL_STM32N657_CRYP_REGMAP \
.base = 0x44020800, \
.size = 0x400
#define WHAL_STM32N657_CRYP_DRIVER &whal_Stm32n6_Cryp_Driver
#define WHAL_STM32N657_CRYP_BASE 0x44020800

#define WHAL_STM32N657_HASH_REGMAP \
.base = 0x44020400, \
.size = 0x400
#define WHAL_STM32N657_HASH_DRIVER &whal_Stm32n6_Hash_Driver
#define WHAL_STM32N657_HASH_BASE 0x44020400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants