The official git repository for OSD-Contiki, the open source OS for the Internet of Things
Go to file
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
apps er-coap: add client-side support for CoAP Observe 2015-02-24 22:46:48 +01:00
core Merge pull request #914 from cetic/pr-always-send-no-path-dao 2015-03-06 14:33:07 +01:00
cpu Use additive offsets 2015-03-28 17:28:15 +01:00
dev Make it possible to set and get the CC2420's CCA threshold through the extended radio API. 2015-02-19 11:26:43 +01:00
doc Expand macros when building docs 2015-02-22 16:39:49 +00:00
examples Added SHT25 sensor 2015-03-10 15:33:58 +01:00
platform Removed duplicated condition in sht25 configuration 2015-03-11 14:25:23 +01:00
regression-tests Add cc26xx travis tests 2015-02-25 13:16:27 +01:00
tools Fixed HC analyser for SAC and DAC fields 2015-02-16 13:58:36 +01:00
.gitignore Add CC26xx build artifacts to .gitignore 2015-02-25 13:16:07 +01:00
.gitmodules Added the cc2538-bsl submodule to the tools dir 2014-03-07 15:44:29 +01:00
.travis.yml Add cc26xx travis tests 2015-02-25 13:16:27 +01:00
CONTRIBUTING.md Adding a CONTRIBUTING file to use github feature 2014-07-04 09:29:12 +02:00
LICENSE Removed the explicit year 2012 to make it more generic 2012-10-25 23:08:54 +02:00
Makefile.include Cleanup UIP_CONF_IPV6_RPL configuration 2014-12-02 12:38:55 +01:00
README-BUILDING.md Rename to md 2013-03-26 23:15:37 +01:00
README-EXAMPLES.md Several minor consistency improvements. 2013-07-31 00:55:31 +02:00
README.md Rename to md 2013-03-26 23:15:37 +01:00

The Contiki Operating System

Build Status

Contiki is an open source operating system that runs on tiny low-power microcontrollers and makes it possible to develop applications that make efficient use of the hardware while providing standardized low-power wireless communication for a range of hardware platforms.

Contiki is used in numerous commercial and non-commercial systems, such as city sound monitoring, street lights, networked electrical power meters, industrial monitoring, radiation monitoring, construction site monitoring, alarm systems, remote house monitoring, and so on.

For more information, see the Contiki website:

http://contiki-os.org