1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18846 from kfessel/p-pm-layerd-speedup1

sys/pm_layered: align pm_blocker_t for speed
This commit is contained in:
Karl Fessel 2022-11-08 10:50:16 +01:00 committed by GitHub
commit c354ab6285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -37,6 +37,7 @@
#include <stdint.h>
#include "periph_cpu.h"
#include "architecture.h"
#ifdef __cplusplus
extern "C" {
@ -55,7 +56,7 @@ extern "C" {
*/
typedef struct {
uint8_t blockers[PM_NUM_MODES]; /**< number of blockers for the mode */
} pm_blocker_t;
} WORD_ALIGNED pm_blocker_t;
/**
* @brief Block a power mode

View File

@ -19,7 +19,6 @@
*/
#include <assert.h>
#include <string.h>
#include "board.h"
#include "irq.h"
@ -75,6 +74,7 @@ void pm_set_lowest(void)
irq_restore(state);
}
__attribute__((optimize(3)))
void pm_block(unsigned mode)
{
DEBUG("[pm_layered] pm_block(%d)\n", mode);
@ -85,6 +85,7 @@ void pm_block(unsigned mode)
irq_restore(state);
}
__attribute__((optimize(3)))
void pm_unblock(unsigned mode)
{
DEBUG("[pm_layered] pm_unblock(%d)\n", mode);
@ -100,7 +101,7 @@ pm_blocker_t pm_get_blocker(void)
pm_blocker_t result;
unsigned state = irq_disable();
memcpy(&result, &pm_blocker, sizeof(result));
result = pm_blocker;
irq_restore(state);
return result;