Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch: inline up_interrupt_context() #6286

Merged
merged 1 commit into from May 25, 2022
Merged

Conversation

anchao
Copy link
Contributor

@anchao anchao commented May 17, 2022

Summary

arch: inline up_interrupt_context()

inline the up_interrupt_context() to avoid unnecessary stack pushes

Signed-off-by: chao.an anchao@xiaomi.com

Impact

N/A

Testing

ci check

@davids5
Copy link
Contributor

davids5 commented May 17, 2022

What are the code size and C89 implication?

@anchao
Copy link
Contributor Author

anchao commented May 17, 2022

What are the code size and C89 implication?

@davids5 ,

There is a slight increase in code size, but overall the impact is not very serious
lm3s6965-ek:qemu-flat(cortex-m):

Before:

$ size nuttx
   text	   data	    bss	    dec	    hex	filename
 222304	    324	  14848	 237476	  39fa4	nuttx

After:

$ size nuttx
   text	   data	    bss	    dec	    hex	filename
 222320	    324	  14848	 237492	  39fb4	nuttx

sabre-6quad:smp(Cortex-a9,smp):

Before:

$ size nuttx
   text	   data	    bss	    dec	    hex	filename
 127840	    196	  33500	 161536	  27700	nuttx

After:

$ size nuttx
   text	   data	    bss	    dec	    hex	filename
 128096	    196	  33500	 161792	  27800	nuttx

about C89 compatible, It seems that the current code base can no longer be built with c89 normally(without this PR), too many inline keywords, the inline keyword was added in C99, I think we can use the -std=gnu89 flag instead of -std=c89

@anchao anchao force-pushed the 22051701 branch 2 times, most recently from 6b5cedf to 74a40e9 Compare May 17, 2022 16:42
include/nuttx/arch.h Show resolved Hide resolved
include/nuttx/arch.h Show resolved Hide resolved
@anchao anchao force-pushed the 22051701 branch 2 times, most recently from c9c3594 to f55a998 Compare May 17, 2022 19:29
arch/arm/include/irq.h Outdated Show resolved Hide resolved
arch/avr/include/irq.h Outdated Show resolved Hide resolved
arch/avr/include/irq.h Outdated Show resolved Hide resolved
arch/hc/include/irq.h Outdated Show resolved Hide resolved
arch/mips/include/irq.h Outdated Show resolved Hide resolved
@anchao anchao force-pushed the 22051701 branch 2 times, most recently from 6255461 to 01ec857 Compare May 18, 2022 06:33
arch/arm/include/irq.h Outdated Show resolved Hide resolved
arch/z80/include/irq.h Outdated Show resolved Hide resolved
arch/z80/include/irq.h Outdated Show resolved Hide resolved
arch/z16/include/irq.h Outdated Show resolved Hide resolved
arch/x86_64/include/irq.h Outdated Show resolved Hide resolved
arch/x86/include/irq.h Outdated Show resolved Hide resolved
arch/sparc/include/irq.h Outdated Show resolved Hide resolved
arch/renesas/include/irq.h Outdated Show resolved Hide resolved
arch/misoc/include/irq.h Outdated Show resolved Hide resolved
arch/hc/include/irq.h Outdated Show resolved Hide resolved
arch/ceva/include/irq.h Outdated Show resolved Hide resolved
arch/avr/include/irq.h Outdated Show resolved Hide resolved
@anchao anchao force-pushed the 22051701 branch 3 times, most recently from bbed952 to bc836ce Compare May 19, 2022 13:18
arch/x86/include/irq.h Outdated Show resolved Hide resolved
arch/z80/include/irq.h Outdated Show resolved Hide resolved
arch/or1k/include/irq.h Show resolved Hide resolved
arch/sim/include/irq.h Show resolved Hide resolved
@anchao anchao force-pushed the 22051701 branch 2 times, most recently from 7505ce5 to f418566 Compare May 24, 2022 14:23
@anchao anchao force-pushed the 22051701 branch 2 times, most recently from c35a0a5 to fbbda02 Compare May 25, 2022 02:37
arch/mips/include/irq.h Outdated Show resolved Hide resolved
arch/mips/include/irq.h Outdated Show resolved Hide resolved
inline the up_interrupt_context() to avoid unnecessary stack pushes

Signed-off-by: chao.an <anchao@xiaomi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants