contiki/cpu/cc2538/dev
Benoît Thébaudeau 19fd7a3551 Use additive offsets
OR-ing an offset to a base address instead of adding it is dangerous
because it can only work if the base address is aligned enough for the
offset.

Moreover, if the base address or the offset has a value unknown at
compile time, then the assembly instructions dedicated to 'base +
offset' addressing on most CPUs can't be emitted by the compiler because
this would require the alignment of the base address against the offset
to be known in order to optimize 'base | offset' into 'base + offset'.
In that case, the compiler has to emit more instructions in order to
compute 'base | offset' on most CPUs, e.g. on ARM, which means larger
binary size and slower execution.

Hence, replace all occurrences of 'base | offset' with 'base + offset'.
This must become a coding rule.

Here are the results for the cc2538-demo example:
 - Compilation of uart_init():
    * before:
        REG(regs->base | UART_CC) = 0;
        200b78:	f446 637c 	orr.w	r3, r6, #4032	; 0xfc0
        200b7c:	f043 0308 	orr.w	r3, r3, #8
        200b80:	2200      	movs	r2, #0
        200b82:	601a      	str	r2, [r3, #0]

    * now:
        REG(regs->base + UART_CC) = 0;
        200b7a:	2300      	movs	r3, #0
        200b7c:	f8c4 3fc8 	str.w	r3, [r4, #4040]	; 0xfc8

 - Size of the .text section:
    * before:	0x4c7c
    * now:	0x4c28
    * saved:	84 bytes

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2015-03-28 17:28:15 +01:00
..
adc.c cc2538: Add adc driver and example 2013-12-06 22:07:45 +01:00
adc.h cc2538: Add adc driver and example 2013-12-06 22:07:45 +01:00
ana-regs.h Corrected the register offset value of ANA_REGS_IVCTRL. TI was using the address offset instead of the physical address in their header file. 2014-12-19 04:14:34 -05:00
cc2538-rf.c corrected code style error 2015-02-13 13:46:57 +01:00
cc2538-rf.h Don't hardcode min and max TX power values 2014-04-23 12:16:50 +01:00
cctest.h cc2538: Add adc driver and example 2013-12-06 22:07:45 +01:00
flash-cca.h cc2538: Add header file for flash CCA page and use it 2013-12-05 18:45:51 +01:00
gpio.c Use additive offsets 2015-03-28 17:28:15 +01:00
gpio.h Use additive offsets 2015-03-28 17:28:15 +01:00
gptimer.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
ioc.c New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
ioc.h Improve wording 2015-02-16 10:17:58 +01:00
mpu.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
nvic.c Use additive offsets 2015-03-28 17:28:15 +01:00
nvic.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
random.c Fix CC2538 random_init lockup 2014-04-13 14:38:00 +01:00
rfcore-ffsm.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
rfcore-sfr.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
rfcore-xreg.h cc2538: Add adc driver and example 2013-12-06 22:07:45 +01:00
rfcore.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
rom-util.h cc2538: Add driver for the rom utility function library 2013-11-18 12:38:06 +01:00
scb.h Improve wording 2015-02-16 10:17:58 +01:00
smwdthrosc.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
soc-adc.h cc2538: Add adc driver and example 2013-12-06 22:07:45 +01:00
spi.c Improve wording, fix warnigs in the SSI/SPI docs 2015-02-16 10:17:58 +01:00
ssi.h [CC2538-SPI] Implement SPI_FLUSH, spi mode, !CS 2014-04-15 14:07:10 -04:00
sys-ctrl.c cc2538: sys_ctrl: Make it possible to use the 32-kHz crystal 2013-11-15 15:52:10 +01:00
sys-ctrl.h Improve wording 2015-02-16 10:17:58 +01:00
systick.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
uart1.h cc2538: uart: Make it possible to use several UARTs simultaneously 2014-04-17 18:53:44 +02:00
uart.c Use additive offsets 2015-03-28 17:28:15 +01:00
uart.h CC2538: Add hardware flow control (RTS/CTS) support on UART1. 2014-06-03 12:38:24 -04:00
udma.c cc2538: Move SoC data to a dedicated section to save space 2013-12-23 15:06:13 +01:00
udma.h Fix doxygen warning in the CC2538 uDMA driver's header 2015-02-16 10:17:57 +01:00
usb-regs.h New Platform: TI CC2538 Development Kit 2013-04-06 21:07:31 +01:00
watchdog.c Confine CC2538 WDT on/off conf inside the driver 2014-05-18 14:12:16 +02:00