Commit graph

42249 commits

Author SHA1 Message Date
Arkadiusz Lichwa
ab0b3a8303 Bluetooth: AVDTP: Fix getting inaccessible internal
conn->handle belongs to core stack space. Apps shouldn't get access to
it. This fixes build/compiler error when Kconfig's DEBUG_AVDTP is defined.

Change-Id: Id188b367e1e4b7d377a7ef59c0f672229ad98fd8
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
13ac9cc9c6 Bluetooth: AVDTP: Remove internal headers
The protocol for audio distribution shouldn't have references to internal
core stack space.

Change-Id: Ifce00856dfb8e48d406f815d54cf4b493a7a2770
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
fdfad74bca Bluetooth: A2DP: Remove internal stack headers
The profile code as sort of user application shouldn't use internal core
stack headers.

Change-Id: I3c6aabf0ee8e1bedac0bd99ebc8526d735219369
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Kaustav Dey Biswas
ab30160708 Bluetooth: SDP: Server: Initialize and accept incoming connections
Initialize SDP, register to L2CAP and accept incoming connections

Change-Id: I568db63910d9e6ff418581b9943d528d4260b859
Signed-off-by: Kaustav Dey Biswas <kaustav.d.biswas@intel.com>
2016-10-04 08:12:14 +03:00
Johan Hedberg
566780ca91 Bluetooth: tests: Fix name of Quark SE C1000 SS devboard
This board was recently renamed, but apparently this reference was
left out.

Change-Id: I9789fa45eab6a9b3118f0f0857ef2207311597f3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Johan Hedberg
49d2bb13cd Bluetooth: L2CAP: Extend bt_l2cap_create_pdu() with 'reserve' parameter
This makes it possible for protocols to reserve headroom for their own
headers.

Change-Id: I64530febc4b86b45a379660197f0ff63671fab6e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
71163ac9dc Bluetooth: init: Add HFP to automated tests
Adds HFP HF stack code to automated tests during build coverage.

Change-Id: Ic7bf5f0077b38bbe0feed167935dee73c989a523
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
58d47f0b99 Bluetooth: RFCOMM: Handle session disconnection from peer
UA response will be sent and session will be cleaned up.
Session will also be cleaned up if l2cap channel is disconnected.

> ACL Data RX: Handle 256 flags 0x02 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Disconnect (DISC) (0x43)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0x53 poll/final 1
         Length: 0
         FCS: 0xfd

< ACL Data TX: Handle 256 flags 0x00 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Ack (UA) (0x63)
         Address: 0x03 cr 1 dlci 0x00
         Control: 0x73 poll/final 1
         Length: 0
         FCS: 0xd7

Change-Id: I44997d7d13c90a2a0814520ea11e6f14bc60271f
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
ef1a5527e7 Bluetooth: HFP HF: Enforce Kconfig's HFP_HF relation to RFCOMM
Whenever turning on HFP HF support there's a need to toggle on 
automatically RFCOMM support.

Change-Id: I2fb75c09534d0b6e49a403a527e1caa7d6f9ffaf
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Vinayak Chettimada
8e25789052 Bluetooth: Controller: Remove custom irq implementation
As part of an effort to closely integrate with Zephyr OS,
removed the custom implementation of IRQ interfaces used
in controller code.

Jira: ZEP-841

Change-id: Ie427f45aeecad51053112371526cb7dc4817248f
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Vinayak Chettimada
54164b1350 Bluetooth: Controller: Fix SCHED_ADVANCED cond, compilation
Code under SCHED_ADVANCED macro in ctrl.c is used to
disable advanced radio time space scheduling calculations
used for placing non-overlapping observer and master roles;
to populate connection parameter request/response PDU
fields, and autonomous generation of slave initiated
connection parameter requests.

This macro shall always be enabled for optimal and correct
operation of the controller, It shall only be disabled to
debug failures in other part of the controller, to rule out
this code's influence, if any, on the failure being
debugged.

Change-id: I04e5f837ef0a5658361bd3668f583f1e13504570
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
97b32a0468 Bluetooth: HFP HF: Fix getting inaccessible internal
The profile (application layer) shouldn't use direct (de)references
to internal stack context members.

Change-Id: I772134a5016de6706c30f058545b3c64c0894202
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
2fb8a11906 Bluetooth: Controller: Fix __packed placement
Place __packed at the end of the structure definition in line
with the rest of the Zephyr codebase.

Jira: ZEP-732

Change-Id: I25aa731cbd188a6e23ca2035eb22fa919295bb25
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Szymon Janc
7ea426a8f1 Bluetooth: L2CAP: Cleanup flags names for BR/EDR channels
This makes all flags used for BR/EDR L2CAP be stored in single place.
Connection oriented flags and signaling flags are now sharing same
atomic.

Change-Id: If01b29009f9c60ed529338122992b9b5e31f883a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
e9d32ed6e1 Bluetooth: Controller: Remove unused macro
Leftover from previous commits, this macro is not used anymore in
the HCI implementation.

Change-Id: I376c92a6b68432d2ff818ea25e68f087131e8479
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Jaganath Kanakkassery
5c1ce90926 Bluetooth: RFCOMM: Handle dlc disconnection from peer
Sends UA response for the DISC request from peer and clean up
dlc. Disconnected callback will be called to profile. Dummy
buf and credit will be used to wake up the tx fiber for exit
and cleanup.

> ACL Data RX: Handle 256 flags 0x02 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Disconnect (DISC) (0x43)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x53 poll/final 1
         Length: 0
         FCS: 0xb8

< ACL Data TX: Handle 256 flags 0x00 dlen 8
      Channel: 64 len 4 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Ack (UA) (0x63)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0x73 poll/final 1
         Length: 0
         FCS: 0x92

Change-Id: I4ec19a93d13a95a9cf4fc5a9beaf48ba8c98689d
Signed-off-by: Jaganath Kanakkassery <jaganathx.kanakkassery@intel.com>
2016-10-04 08:12:14 +03:00
Mariusz Skamra
c76da25cac Bluetooth: tester: Fix advertising data
This fixes data passed to the BTP Device Found event.

Change-Id: I1ab465b87ce24f3ea10b7217c254aafaee494c91
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-10-04 08:12:14 +03:00
Arkadiusz Lichwa
e3506ca120 Bluetooth: RFCOMM: Shuffle up Kconfig's RFCOMM_L2CAP_MTU
Moves RFCOMM frames max length settings directly under the main RFCOMM
selector for better relations readability. It uses 'depends on' clause
for RFCOMM dependency and proper indentation.

Change-Id: Ic4dc0ffddaf8b438ace1f455191b7a707c0e9ed6
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
2f33724017 Bluetooth: Controller: Use net_buf for evt and ACL RX
Use the net_buf structure directly when populating incoming
ACL data or asynchronous events. This ensures that no additional
memcpy() operations are required and removes completely the
statically allocated buffers in hci.c.

Jira: ZEP-726

Change-Id: I6ac8bd0becb7037ce8ecfac109f44832d23fcfd2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Szymon Janc
36b8e8cdc8 Bluetooth: Add debug keys support to HCI ECC emulation code
This was initialy done in SMP code but was lost when moved to HCI ECC
emulation. With this patch if CONFIG_BLUETOOTH_USE_DEBUG_KEYS is set
ECC emulation code uses debug public and private keys as specified
in Core Specifitation 4.2 Vol 3. Part H 2.3.5.6.1.

Change-Id: I626e7e1c6bde2baeae642d6f2c60c324fdd0369f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Szymon Janc
f4d75398ca Bluetooth: SMP: Fix unused static variable
gen_method_legacy is used only if SMP SC only mode is not enabled.
This fix compilation warning on some GCC version.

Change-Id: I183c5d0072c2f76da78bf0d2b1077c8d0620f688
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Szymon Janc
aa6a9b0066 Bluetooth: SMP: Remove unused static const
This is no longer used and can produce warning on some GCC versions.

Change-Id: Ib19903ea41d6446983a738ea99912dc5ba9b88f8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
0a720c4771 Bluetooth: Controller: Use net_buf for CC/CS TX
Preallocate a response event net_buf buffer before processing an
incoming command and provide it to hci.c so that it populates
the event directly, instead of using a temporary buffer than
must then be copied into the return net_buf.
This applies exclusively to Command Complete and Command
Status, since those are the only events that are sent in
direct respone to an incoming command.

Jira: ZEP-726

Change-Id: Ia3ea71ac497690af929c44308760f68491ea829e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
6877651a30 Bluetooth: GATT: Fix locking RX fiber
If an indication is received while there is an outstanding request the
code will attempt to get a buffer from req_pool to confirm which may
block causing the RX fiber to lock and probably crash as the request
won't release the buffer until it gets a response or timeout.

JIRA: ZEP-940

Change-Id: I3df30db473a0c6c6c3e63b1d0b410a50bdd3accf
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
d12b6c87c9 Bluetooth: Controller: Use net_buf for HCI RX
Instead of copying the net_buf contents into a temporary
buffer byte-by-byte, the Controller HCI code now handles
incoming commands and ACL packets from the Host directly
in the net_buf containers, to avoid unnecessary memory
copying and to align with the rest of the Bluetooth stack.

Jira: ZEP-726

Change-Id: I9802607d84ee6206218b711e7e6e23dafb70581a
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
85f82d7985 Bluetooth: init: Add CONFIG_BLUETOOTH_A2DP to prj_20.conf
This makes sure A2DP support is build tested on each patch.

Change-Id: I9dba5c20d44d8ac92910e80c1ad97ac8d2207652
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Itankar, Piyush T
acb8c75648 Bluetooth: A2DP: Initialization of A2DP
A2DP Initialization, registers callback functions with AVDTP.

Change-Id: I6b24ca5e7906c08774a173f35da28b1711f34577
Signed-off-by: Itankar, Piyush T <piyush.t.itankar@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
52efcf8acd Bluetooth: AVDTP: Add missing BLUETOOTH_DEBUG_AVDTP
Change-Id: Ib2243f85bb06df9d98d258bce11d4e7ac87f212d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
4c44e66a5c Bluetooth: init: Add CONFIG_BLUETOOTH_AVDTP to prj_20.conf
This makes sure AVDTP support is build tested on each patch.

Change-Id: Ia7cf94ca84fa01bd676a99b0df58ac745bbfc8c7
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
324b3a2948 Bluetooth: init: Add CONFIG_BLUETOOTH_RFCOMM to prj_20.conf
This makes sure RFCOMM support is build tested on each patch.

Change-Id: I9cd60da1b0ab0db2b41487393fb59fe1b415ea01
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Arun Jagadish
3afc05d816 Bluetooth: AVDTP: Module Initialization
- Data Structure Definition
- Registration and Initialization

Change-Id: Icca95ccbd2692a7d41fd41ef2c99e34761e864b3
Signed-off-by: Arun Jagadish <arun.jagadish@intel.com>
2016-10-04 08:12:14 +03:00
Carles Cufi
f976decdfa Bluetooth: Controller: Clean up naming in the HCI driver
As part of the effort to consolidate the BLE Controller's
HCI layer, the functions in hci_driver.c now use the "hci_driver_"
prefix when it is sensible to do so, and prefixes have been
removed altogether when they are not required.

Jira: ZEP-726

Change-Id: Icd3e56e0170f15636245ea12a389a5a9e86c166c
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-04 08:12:14 +03:00
Luiz Augusto von Dentz
c4fb8f8820 Bluetooth: eddystone: Add missing characteristics
This adds last 2 missing characteristics:

(Advanced) Factory reset - a3c8750b-8ed3-4bdf-8a39-a01bebede295
(Advanced) Remain Connectable - a3c8750c-8ed3-4bdf-8a39-a01bebede295

Change-Id: I749b4be65469080a24957805d40395563a74a972
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Maureen Helm
51c146b95b frdm_k64f: Add support for RGB LEDs
Add PTB22, PTE26, and PTB21 to the frdm_k64f pinmux table, and helper
macros to board.h to map them to red, green, and blue LEDs respectively.

Change-Id: I257621467e71dfd9bdc5d97d6da444dfb5c58b2b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-04 01:29:14 +00:00
Maureen Helm
a6b57c9455 frdm_k64f: Add support for push button switches
Add PTC6 and PTA4 to the frdm_k64f pinmux table, and helper macros in
board.h to map them to SW2 and SW3 respectively.

Change-Id: Ia30df9015d6d3c09131b4fbb2f2009ee745f7268
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-10-04 01:23:00 +00:00
Yannis Damigos
84ae7d83d6 scripts/sysgen: Fix indentation inconsistency
Building samples or running sanitycheck script fails with
the following error using python 3:
Using /home/xekarfwtos/projects/zephyr as source for kernel
GEN     ./Makefile
CHK     include/generated/version.h
HOSTCC  scripts/basic/fixdep
HOSTCC  scripts/gen_idt/version.o
HOSTCC  scripts/gen_idt/gen_idt.o
HOSTLD  scripts/gen_idt/gen_idt
HOSTCC  scripts/gen_offset_header/gen_offset_header.o
HOSTLD  scripts/gen_offset_header/gen_offset_header
CHK     misc/generated/configs.c
CHK     include/generated/offsets.h
CHK     misc/generated/sysgen/prj.mdef
UPD     misc/generated/sysgen/prj.mdef
File "/home/xekarfwtos/projects/zephyr/scripts/sysgen", line 687
  kernel_main_c_out("K_MSGQ_DEFINE(_k_fifo_obj_%s, %s, %s);\n" %
				                               ^
TabError: inconsistent use of tabs and spaces in indentation

This patch fixes the indentation inconsistency allowing building
using python 3.

Change-Id: I51bda9452e7ff97fe9f07544927d76ce981700d1
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-10-03 20:33:28 +00:00
Peter Mitsis
6704ff462e kernel: Add __unused tag
The '__unused' tag can be used to inform the compiler that a variable
might be deliberately unused. It can be used instead of ARG_UNUSED().

Change-Id: I0ec4ee92dcec29b5f9cbda362d0d6b051055628a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:22:05 +00:00
Peter Mitsis
27a21a8e09 nanokernel: nanokernel.h to include sections.h
Mirrors kernel.h to allow both nanokernel and microkernel applications
easy access to section tags such as __noinit.

Change-Id: Ie01395ac63393b7afbebfe26c723702918bfe9ff
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:20:23 +00:00
Peter Mitsis
0cb65c3c0d unified: Eliminate k_mem_pool_t typedef
Replaces it with a pointer as there is no need for an opaque memory
pool type.

Jira: ZEP-916
Change-Id: I5493eed25c9c34e1b850dc3b20699864edb22d28
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:17:02 +00:00
Peter Mitsis
0ca7cea8f3 unified: Relocate internal thread group APIs
Moves the following internal thread group APIs from the public
kernel.h header file to the more private thread.c source file as
they do not need to be public APIs.
	_k_task_list_start[];
	_k_task_list_end[];
	_FOREACH_STATIC_THREAD()
	is_in_any_group()

Change-Id: I0b731fb0c20a5574cb1b3c1397803af82918d69d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:17:02 +00:00
Marcus Shawcroft
9d67337c2d k64f: Refactor pinmux configuration table.
Statically compute the number of elements in the pinmux table rather
than keep a manual entry in step with the table.

Change-Id: I99634aa460a39bb8a9a10fe37d28aaae792aa641
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-03 19:49:40 +00:00
Carles Cufi
bb9f432dc1 toolchain: Add BUILD_ASSERT macro for compile-time checks
This new macro will trigger a build failure if the compile-time
check fails. Useful for checking static conditions such as
structure sizes or offsets.

Change-Id: I417ea816003b97beb1b5f15bc583c38691f0b8a9
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-03 19:41:08 +00:00
Ramesh Thomas
0d2b8224b1 timer: Fixes a build error when MVIC is used
MVIC does not have _REG_TIMER_CFG defined because it does
not have a timer config register. Add checks for MVIC at
places where it is used.

Jira: ZEP-1015
Change-Id: I59f5c43cc2d1b17cf9e88b940631c2542e9729ab
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-03 17:28:02 +00:00
Daniel Thompson
90f6ae1532 build: Support for integrating third party build systems
For projects like JerryScript and Micropython we are starting to see
hybrid build systems emerge where the application (which targets a
variety of OSs and already includes a complex build system) is compiled
using the applications own build system before handing over to the
zephyr build system for the final link.

Currently the integration is becoming quite complex as the applications
build integration tries to figure out sane values for CC and CFLAGS.
Much of this complexity can be avoided if we allow the zephyr build
system to export its configuration in a manner that can easily be
consumed by the alien build system.

Change-Id: I4ea4cda2ed0437222d9550c50f0b07e51d9ac91b
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-10-03 02:30:51 +00:00
Anas Nashif
c83e6a1f48 libc: define EWOULDBLOCK to be the same as EAGAIN
EWOULDBLOCK is an old error code from BSD. Not much uses it, and on basically
all modern systems it's defined to the same value as EAGAIN, which is the
System V value for the same condition.

Jira: ZEP-982
Change-Id: I5435ce55fa47f5bd2fac5d881b5b195b025f48a2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:42 +00:00
Anas Nashif
0cf87e4c26 pinmux: remove nonexistant galileo Kconfig
Change-Id: I9f2fb8024f3de6fa6aaf1220ecfa884fabb6ad74
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:23 +00:00
Anas Nashif
1b4742f8a4 help: document ram/rom_report in 'make help'
Change-Id: I0b0b477cc19bb8966a67c6f1e5705f58d8679578
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:22 +00:00
Anas Nashif
315862f59a tests: remove redundant PRINT definition
Change-Id: I0ac5b3730a9a84b89f392c58e3b65e47cbdf132b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-03 02:29:22 +00:00
Andy Ross
0f227848b9 link: Add section size validity checker
There are demons hiding in binutils with regard to the size of the
data section that needs to be copied in XIP platforms.  It's easy to
mess up and get a mismatch between the linker data output and the
runtime addresses.  Add a cheap check to discover this early when it
occurs.

Jira: ZEP-955

Change-Id: If1c61fe8712221c6450b5b89f5f8af006b41b3fe
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-01 01:41:51 +00:00
Andy Ross
6b3c5e8bb2 x86 link: Specify ALIGN_WITH_INPUT for XIP data sections
Binutils ld has an annoying misfeature (apparently a regression from a
few years ago) that alignment directives (and alignment specifiers on
symbols) apply only to the runtime addresses and not, apparently, to
the load address region specified with the "AT>" syntax.  The net
result is that by default the LMA output ends up too small for the
addresses generated in RAM.  See here for some details:

    https://sourceware.org/ml/binutils/2013-06/msg00246.html
    https://sourceware.org/ml/binutils/2014-01/msg00350.html

The required workaround/fix is that AFAICT any section which can have
inherit a separate VMA vs. LMA from a previous section must specify an
"ALIGN_WITH_INPUT" attribute.  Otherwise the sections will get out of
sync and the XIP data will be wrong at runtime.

No, I don't know why this isn't the default behavior.

A further complexity is that this feature only works as advertised
when the section is declared with the "AT> region" syntax after the
block and not "AT(address)" in the header.  If you use the header
syntax (with or without ALIGN_WITH_INPUT), ld appears to DOUBLE-apply
padding and the LMA ends up to big.  This is almost certainly a
binutils bug, but it's trivial to work around (and the working syntax
is actually cleaner) so we adjust the usage here.

Note finally that this patch includes an effective reversion of commit
d82e9dd9 ("x86: HACK force alignment for _k_task_list section"), which
was an earlier workaround for what seems to be the same issue.

Jira: ZEP-955

Change-Id: I2accd92901cb61fb546658b87d6752c1cd14de3a
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-10-01 01:41:50 +00:00