mirror of https://github.com/ARMmbed/mbed-os.git
Exclude MPU manager code if MPU disabled
Save around 400 bytes from images using FlashIAP by omitting MPU manager reference counting if DEVICE_MPU is 0.pull/9064/head
parent
784c80f9e9
commit
bb4cb774a2
|
@ -20,6 +20,8 @@
|
|||
#include "hal/mpu_api.h"
|
||||
#include <limits.h>
|
||||
|
||||
#if DEVICE_MPU
|
||||
|
||||
static uint16_t mem_xn_lock;
|
||||
static uint16_t mem_wn_lock;
|
||||
|
||||
|
@ -78,3 +80,5 @@ void mbed_mpu_manager_unlock_rom_write()
|
|||
}
|
||||
core_util_critical_section_exit();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if DEVICE_MPU
|
||||
|
||||
/** Lock ram execute never mode off
|
||||
*
|
||||
* This disables the MPU's execute never ram protection and allows
|
||||
|
@ -80,6 +82,18 @@ void mbed_mpu_manager_lock_rom_write(void);
|
|||
*/
|
||||
void mbed_mpu_manager_unlock_rom_write(void);
|
||||
|
||||
#else
|
||||
|
||||
#define mbed_mpu_manager_lock_ram_execution() (void)0
|
||||
|
||||
#define mbed_mpu_manager_unlock_ram_execution() (void)0
|
||||
|
||||
#define mbed_mpu_manager_lock_rom_write() (void)0
|
||||
|
||||
#define mbed_mpu_manager_unlock_rom_write() (void)0
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue