zephyr/include
Daniel Leung 212ec9a29a linker: sort app shared mem partition by alignment
If CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT is enabled,
the app shared memory partition may cause waste of memory
due to the need for padding.

For example, tests/subsys/jwt and board mps2_an385:

  z_test_mem_partition: addr 0x20000000, size 52
  z_libc_partition    : addr 0x20000040, size 4
  k_mbedtls_partition : addr 0x20008000, size 32736

    ending at 0x2000ffff, taking up 65536 bytes

With power-of-two size and alignment requirement,
k_mbedtls_partition takes up 32KB memory and needs to be
aligned on 32KB boundary. If the above partitions are
ordered as shown, there needs to be a lot of padding
after z_libc_partition before k_mbedtls_partition can
start. In order to minimize padding, these partitions
need to be sort by size in descending order.

After the changes here,	the partitions are:

  k_mbedtls_partition : addr 0x20000000, size 32736
  z_test_mem_partition: addr 0x20008000, size 52
  z_libc_partition    : addr 0x20008040, size 4

    ending at 0x2000805f, taking up 32864 bytes

With the above example, sorting results in a saving
of 32672 bytes of saving.

Fixes #14121

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-13 18:26:51 +01:00
..
app_memory all: Update reserved function names 2019-03-11 13:48:42 -04:00
arch linker: move app_smem.ld into include/linker 2019-03-13 18:26:51 +01:00
audio
bluetooth Bluetooth: GATT: Add BT_GATT_DISCOVER_ATTRIBUTE type 2019-03-13 17:48:37 +02:00
cmsis_rtos_v1
cmsis_rtos_v2 CMSIS RTOS V2: Introduce CMSIS RTOS V2 API header file 2018-12-20 12:23:22 +01:00
crypto
debug include: remove unused header file gdb_server.h 2019-01-22 07:45:22 -05:00
dfu dfu: mcuboot: rename boot_swap_type> mcuboot_swap_type 2019-02-19 09:32:02 +01:00
display doc: add missing cfb API 2019-01-03 12:38:28 -05:00
drivers all: Update reserved function names 2019-03-11 13:48:42 -04:00
dt-bindings interrupt_controller: RV32M1: add intmux driver / DT bindings 2019-01-25 11:59:46 -05:00
fs
linker linker: sort app shared mem partition by alignment 2019-03-13 18:26:51 +01:00
logging all: Update reserved function names 2019-03-11 13:48:42 -04:00
mgmt smp: shell: Add support for SMP in new shell. 2019-01-15 17:19:20 -05:00
misc libc: rename _zephyr_fputc to zephyr_fputc 2019-03-12 13:59:06 -05:00
net net/pkt: Enable allocating from external slab and data pool on new API 2019-03-11 20:56:44 -07:00
nvs fs/nvs: Improve init speed and remove fs->locked 2019-02-21 09:32:52 -05:00
posix all: Update reserved function names 2019-03-11 13:48:42 -04:00
random
settings doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
shell shell: Making root command a global variable 2019-02-20 07:31:35 -05:00
toolchain all: Update reserved function names 2019-03-11 13:48:42 -04:00
usb usb: dfu: Signal completion of DFU 2019-03-08 08:35:59 -05:00
zephyr jwt: Add JSON web token library 2019-02-08 15:32:58 -06:00
adc.h adc: return EBUSY when requesting new sampling while one in progress 2019-03-07 09:41:19 -05:00
aio_comparator.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
atomic.h atomic: Add atomic_set_bit_to() API 2019-01-25 17:35:44 -05:00
base64.h
cache.h
can.h can: Make frame and filter conversion function params const 2019-03-13 05:58:30 -05:00
clock_control.h
console.h doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
counter.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
crc8.h
crc16.h
crc32.h
crc.h crc: Move crc7 into CRC single header 2018-12-30 16:24:10 -05:00
device.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
disk_access.h
display.h drivers: display: Add RGB 565 pixel format to display api 2019-02-07 14:28:55 -06:00
dma.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
entropy.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
exc_handle.h
fcb.h
flash_map.h dts: flash_map: Automatically generate of the list of flash area 2019-02-07 10:31:27 -06:00
flash.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
fs.h doc: consolidated filesystem API reference 2019-02-05 07:04:40 -05:00
generated_dts_board.h cmake: Fix the generation of fixup files 2019-01-28 12:18:38 -05:00
gna.h doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
gpio.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
hwinfo.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
i2c.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
i2s.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
init.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
ipm.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
irq_nextlevel.h
irq_offload.h
irq.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
json.h
kernel_includes.h kernel/work_q: Spinlockify 2019-02-08 14:49:39 -05:00
kernel_version.h doc: add kernel version API to doxygen 2018-12-08 17:24:53 -05:00
kernel.h kernel/work_q: Fix locking across multiple queues 2019-03-12 18:37:41 +01:00
led_strip.h
led.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
pinmux.h
power.h power: Fix switch usage 2019-03-05 14:58:58 -08:00
ptp_clock.h
pwm.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
ring_buffer.h
rtc.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
sched_priq.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
sensor.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
shared_irq.h
spi.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
spinlock.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
stats.h include: stats.h: Packed attribute was incorrect. 2018-12-07 10:32:41 -05:00
sw_isr_table.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
sys_clock.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
sys_io.h
syscall.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
toolchain.h
tracing.h debug: CTF Tracing with POSIX backend 2019-02-01 08:56:02 -05:00
tty.h doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
uart.h include: uart: Fix function reference in docstrings 2019-03-11 14:55:58 -04:00
watchdog.h drivers: watchdog: remove deprecated apis 2019-02-01 10:37:49 -06:00
zephyr.h