[riot-notifications] [RIOT-OS/RIOT] cpu/cortexm_common: add inlined header only def for irq_% (#13999)

Francisco notifications at github.com
Fri May 1 09:31:06 CEST 2020


### Contribution description

irq_% are not inlined by the compiler which leads to it branching
to a function that actually implement a single machine instruction.

Inlining these functions makes the call more efficient as well as
saving some bytes in ROM.

This could probably be done for more arch, but I wanted to first do
it for a single arch first.

### Testing procedure

- All applications should still work

- check footprint difference, `BUILD_IN_DOCKER=1 BOARD=<board>make -C examples/gnrc_networking`

**iotlab-m3 cortexm3:**

- PR

```
  text    data     bss     dec     hex filename
  87536     184   19240  106960   1a1d0 /data/riotbuild/riotbase/examples/gnrc_networking/bin/iotlab-m3/gnrc_networking.elf
```

- master

```
  text    data     bss     dec     hex filename
  87740     184   19240  107164   1a29c /data/riotbuild/riotbase/examples/gnrc_networking/bin/iotlab-m3/gnrc_networking.elf
```

**samr21-xpro cortexm0:**

- PR

```
  text    data     bss     dec     hex filename
  91488     184   19240  110912   1b140 /data/riotbuild/riotbase/examples/gnrc_networking/bin/samr21-xpro/gnrc_networking.elf
```

- master

```
  text    data     bss     dec     hex filename
  91588     184   19240  111012   1b1a4 /data/riotbuild/riotbase/examples/gnrc_networking/bin/samr21-xpro/gnrc_networking.elf
```

**nrf52dk cortexm4:**

- PR

```
  text    data     bss     dec     hex filename
  162048     284   47616  209948   3341c /data/riotbuild/riotbase/examples/gnrc_networking/bin/nrf52dk/gnrc_networking.elf
```

- master

```
  text    data     bss     dec     hex filename
  162248     284   47616  210148   334e4 /data/riotbuild/riotbase/examples/gnrc_networking/bin/nrf52dk/gnrc_networking.elf
```

### Issues/PRs references

Came up a while ago in #11919
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/13999

-- Commit Summary --

  * cpu/cortexm_common: add inlined header only def for irq_%

-- File Changes --

    M core/include/irq.h (47)
    R cpu/cortexm_common/include/irq_arch.h (29)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/13999.patch
https://github.com/RIOT-OS/RIOT/pull/13999.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/13999
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200501/a703a3a5/attachment.htm>


More information about the notifications mailing list