Skip to content

Commit b1ba555

Browse files
author
ganghe
committed
[int][bug][zbt] Fix ZBT init issue in gcc env
Project: Bluetooth redmine: #5146, REDMINE-id ext-redmine: bug|feat#id [Description in detail] Affected branch: [master] Change-Id: Iaba0ec72cccb50293b90d95f869c2300c8581a7c
1 parent 5610552 commit b1ba555

File tree

12 files changed

+124
-40
lines changed

12 files changed

+124
-40
lines changed

zephyr_bt/audio/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,6 @@ if GetDepend(['BT_PBP']):
123123

124124
CPPPATH = [cwd]
125125

126-
group = DefineGroup('zbt_audio', src, depend = ['BT_AUDIO'], CPPPATH=CPPPATH, LIBRARY='zbt_audio')
126+
group = DefineGroup('zbt_audio', src, depend = ['BT_AUDIO'], CPPPATH=CPPPATH)
127127

128128
Return('group')

zephyr_bt/common/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ src = Glob('*.c')
55

66
CPPPATH = [cwd]
77

8-
group = DefineGroup('zbt_common', src, depend = ['ZBT'], LIBRARY='zbt_common')
8+
group = DefineGroup('zbt_common', src, depend = ['ZBT'])
99

1010
Return('group')

zephyr_bt/crypto/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ else:
1010

1111
CPPPATH = [cwd]
1212

13-
group = DefineGroup('zbt_crypto', src, depend = ['ZBT'],CPPPATH = CPPPATH, LIBRARY='zbt_crypto')
13+
group = DefineGroup('zbt_crypto', src, depend = ['ZBT'],CPPPATH = CPPPATH)
1414

1515
Return('group')

zephyr_bt/host/SConscript

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ if GetDepend('BT_CHANNEL_SOUNDING'):
6262
if GetDepend('BT_DF'):
6363
src+=['direction.c']
6464

65-
group = DefineGroup('zbt_host', src, depend = ['ZBT'],CPPPATH = CPPPATH, LIBRARY='zbt_host')
65+
src=list(set(src))
66+
67+
group = DefineGroup('zbt_host', src, depend = ['ZBT'],CPPPATH = CPPPATH)
6668

6769
Return('group')

zephyr_bt/include/rtt4zephyr.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "zephyr/autoconf.h"
1212
#include "bf0_hal_def.h"
1313

14-
1514
extern struct bt_dev bt_dev;
1615
struct arch_esf
1716
{
@@ -117,12 +116,14 @@ enum
117116
#undef IS_ALIGNED
118117

119118
#define BUILD_ASSERT(...)
120-
#define ALWAYS_INLINE __INLINE
119+
#define ALWAYS_INLINE __inline
121120
#define __noasan
122121
#define __fallthrough
123122
#define __noinit
124123
#define __maybe_unused
125-
#define __aligned(x) __ALIGNED(x)
124+
#ifndef __aligned
125+
#define __aligned(x) __ALIGNED(x)
126+
#endif
126127
#define __syscall
127128
#define __subsystem
128129
#define unlikely(x) x
@@ -138,6 +139,10 @@ enum
138139
#define INT_MAX (0x7FFFFFFF)
139140
#endif
140141

142+
#ifndef ESHUTDOWN
143+
#define ESHUTDOWN 110
144+
#endif
145+
141146
/**
142147
* @brief Register an initialization function.
143148
*
@@ -231,7 +236,9 @@ enum
231236
#include "zephyr/sys/__assert.h"
232237
#include "zephyr/sys/atomic.h"
233238
#include "zephyr/sys_clock.h"
234-
#define __used __USED
239+
#ifndef __used
240+
#define __used __USED
241+
#endif
235242

236243
/* Unaligned access */
237244
#define UNALIGNED_GET(g) \

zephyr_bt/include/zbt_data.lds

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_net_buf_pool_list_start = .; KEEP(*(SORT_BY_NAME(._net_buf_pool.static.*))); _net_buf_pool_list_end = .;

zephyr_bt/include/zbt_rom.lds

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
bt_conn_cb_area : SUBALIGN(4)
2+
{
3+
_bt_conn_cb_list_start = .;
4+
KEEP(*(SORT_BY_NAME(._bt_conn_cb.static.*)));
5+
_bt_conn_cb_list_end = .;
6+
} > ROM
7+
8+
#ifdef BT_CONN
9+
bt_l2cap_fixed_chan_area : SUBALIGN(4)
10+
{
11+
_bt_l2cap_fixed_chan_list_start = .;
12+
KEEP(*(SORT_BY_NAME(._bt_l2cap_fixed_chan.static.*)));
13+
_bt_l2cap_fixed_chan_list_end = .;
14+
} > ROM
15+
16+
bt_gatt_service_static_area : SUBALIGN(4)
17+
{
18+
_bt_gatt_service_static_list_start = .;
19+
KEEP(*(SORT_BY_NAME(._bt_gatt_service_static.static.*)));
20+
_bt_gatt_service_static_list_end = .;
21+
} > ROM
22+
#endif
23+
24+
#ifdef BT_IAS
25+
bt_ias_cb_area : SUBALIGN(4)
26+
{
27+
_bt_ias_cb_list_start = .;
28+
KEEP(*(SORT_BY_NAME(._bt_ias_cb.static.*)));
29+
_bt_ias_cb_list_end = .;
30+
} > ROM
31+
#endif
32+
33+
34+
#ifdef BT_MESH
35+
bt_mesh_subnet_cb_area : SUBALIGN(4)
36+
{
37+
_bt_mesh_subnet_cb_list_start = .;
38+
KEEP(*(SORT_BY_NAME(._bt_mesh_subnet_cb.static.*)));
39+
_bt_mesh_subnet_cb_list_end = .;
40+
} > ROM
41+
42+
bt_mesh_app_key_cb_area : SUBALIGN(4)
43+
{
44+
_bt_mesh_app_key_cb_list_start = .;
45+
KEEP(*(SORT_BY_NAME(._bt_mesh_app_key_cb.static.*)));
46+
_bt_mesh_app_key_cb_list_end = .;
47+
} > ROM
48+
49+
bt_mesh_hb_cb_area : SUBALIGN(4)
50+
{
51+
_bt_mesh_hb_cb_list_start = .;
52+
KEEP(*(SORT_BY_NAME(._bt_mesh_hb_cb.static.*)));
53+
_bt_mesh_hb_cb_list_end = .;
54+
} > ROM
55+
56+
bt_mesh_friend_cb_area : SUBALIGN(4)
57+
{
58+
_bt_mesh_friend_cb_list_start = .;
59+
KEEP(*(SORT_BY_NAME(._bt_mesh_friend_cb.static.*)));
60+
_bt_mesh_friend_cb_list_end = .;
61+
} > ROM
62+
63+
64+
bt_mesh_proxy_cb_area : SUBALIGN(4)
65+
{
66+
_bt_mesh_proxy_cb_list_start = .;
67+
KEEP(*(SORT_BY_NAME(._bt_mesh_proxy_cb.static.*)));
68+
_bt_mesh_proxy_cb_list_end = .;
69+
} > ROM
70+
71+
#endif
72+

zephyr_bt/liblc3/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ src = Glob('*.c')
55

66
CPPPATH = [cwd]
77

8-
group = DefineGroup('zbt_lc3', src, depend = ['ZBT'],CPPPATH = CPPPATH, LIBRARY='zbt_lc3')
8+
group = DefineGroup('zbt_lc3', src, depend = ['ZBT'],CPPPATH = CPPPATH)
99

1010
Return('group')

zephyr_bt/net_buf/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ src = Glob('*.c')
55

66
CPPPATH = [cwd]
77

8-
group = DefineGroup('zbt_net_buf', src, depend = ['ZBT'],CPPPATH = CPPPATH, LIBRARY='zbt_net_buf')
8+
group = DefineGroup('zbt_net_buf', src, depend = ['ZBT'],CPPPATH = CPPPATH)
99

1010
Return('group')

zephyr_bt/rtt4zephyr.c

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -176,34 +176,36 @@ int k_mem_slab_alloc(struct rt_mempool *slab, void **mem,
176176
return RT_EOK;
177177
}
178178

179-
__USED struct net_buf_pool _net_buf_pool_list_start SPACE1("._net_buf_pool.static.00_start");
180-
__USED struct net_buf_pool _net_buf_pool_list_end SPACE1("._net_buf_pool.static.zz_end");
181-
182-
#ifdef BT_CONN
183-
__USED const struct bt_conn_cb _bt_conn_cb_list_start SPACE1("._bt_conn_cb.static.00_start");
184-
__USED const struct bt_conn_cb _bt_conn_cb_list_end SPACE1("._bt_conn_cb.static.zz_end");
185-
__USED const struct bt_l2cap_fixed_chan _bt_l2cap_fixed_chan_list_start SPACE1("._bt_l2cap_fixed_chan.static.00_start");
186-
__USED const struct bt_l2cap_fixed_chan _bt_l2cap_fixed_chan_list_end SPACE1("._bt_l2cap_fixed_chan.static.zz_end");
187-
__USED const struct bt_gatt_service_static _bt_gatt_service_static_list_start SPACE1("._bt_gatt_service_static.static.00_start");
188-
__USED const struct bt_gatt_service_static _bt_gatt_service_static_list_end SPACE1("._bt_gatt_service_static.static.zz_end");
189-
#endif
190-
191-
#ifdef BT_IAS
192-
__USED const struct bt_ias_cb _bt_ias_cb_list_start SPACE1("._bt_ias_cb.static.00_start");
193-
__USED const struct bt_ias_cb _bt_ias_cb_list_end SPACE1("._bt_ias_cb.static.zz_end");
194-
#endif
195-
196-
#ifdef BT_MESH
197-
__USED const struct bt_mesh_subnet_cb _bt_mesh_subnet_cb_list_start SPACE1("._bt_conn_cb.static.00_start");
198-
__USED const struct bt_mesh_subnet_cb _bt_mesh_subnet_cb_list_end SPACE1("._bt_conn_cb.static.zz_end");
199-
__USED const struct bt_mesh_app_key_cb _bt_mesh_app_key_cb_list_start SPACE1("._bt_mesh_app_key_cb.static.00_start");
200-
__USED const struct bt_mesh_app_key_cb _bt_mesh_app_key_cb_list_end SPACE1("._bt_mesh_app_key_cb.static.zz_end");
201-
__USED const struct bt_mesh_hb_cb _bt_mesh_hb_cb_list_start SPACE1("._bt_mesh_hb_cb.static.00_start");
202-
__USED const struct bt_mesh_hb_cb _bt_mesh_hb_cb_list_end SPACE1("._bt_mesh_hb_cb.static.zz_end");
203-
__USED const struct bt_mesh_friend_cb _bt_mesh_friend_cb_list_start SPACE1("._bt_mesh_friend_cb.static.00_start");
204-
__USED const struct bt_mesh_friend_cb _bt_mesh_friend_cb_list_end SPACE1("._bt_mesh_friend_cb.static.zz_end");
205-
__USED const struct bt_mesh_proxy_cb _bt_mesh_proxy_cb_list_start SPACE1("._bt_mesh_proxy_cb.static.00_start");
206-
__USED const struct bt_mesh_proxy_cb _bt_mesh_proxy_cb_list_end SPACE1("._bt_mesh_proxy_cb.static.zz_end");
179+
#ifdef __ARMCC_VERSION
180+
__USED struct net_buf_pool _net_buf_pool_list_start SPACE1("._net_buf_pool.static.00_start");
181+
__USED struct net_buf_pool _net_buf_pool_list_end SPACE1("._net_buf_pool.static.zz_end");
182+
183+
#ifdef BT_CONN
184+
__USED const struct bt_conn_cb _bt_conn_cb_list_start SPACE1("._bt_conn_cb.static.00_start");
185+
__USED const struct bt_conn_cb _bt_conn_cb_list_end SPACE1("._bt_conn_cb.static.zz_end");
186+
__USED const struct bt_l2cap_fixed_chan _bt_l2cap_fixed_chan_list_start SPACE1("._bt_l2cap_fixed_chan.static.00_start");
187+
__USED const struct bt_l2cap_fixed_chan _bt_l2cap_fixed_chan_list_end SPACE1("._bt_l2cap_fixed_chan.static.zz_end");
188+
__USED const struct bt_gatt_service_static _bt_gatt_service_static_list_start SPACE1("._bt_gatt_service_static.static.00_start");
189+
__USED const struct bt_gatt_service_static _bt_gatt_service_static_list_end SPACE1("._bt_gatt_service_static.static.zz_end");
190+
#endif
191+
192+
#ifdef BT_IAS
193+
__USED const struct bt_ias_cb _bt_ias_cb_list_start SPACE1("._bt_ias_cb.static.00_start");
194+
__USED const struct bt_ias_cb _bt_ias_cb_list_end SPACE1("._bt_ias_cb.static.zz_end");
195+
#endif
196+
197+
#ifdef BT_MESH
198+
__USED const struct bt_mesh_subnet_cb _bt_mesh_subnet_cb_list_start SPACE1("._bt_conn_cb.static.00_start");
199+
__USED const struct bt_mesh_subnet_cb _bt_mesh_subnet_cb_list_end SPACE1("._bt_conn_cb.static.zz_end");
200+
__USED const struct bt_mesh_app_key_cb _bt_mesh_app_key_cb_list_start SPACE1("._bt_mesh_app_key_cb.static.00_start");
201+
__USED const struct bt_mesh_app_key_cb _bt_mesh_app_key_cb_list_end SPACE1("._bt_mesh_app_key_cb.static.zz_end");
202+
__USED const struct bt_mesh_hb_cb _bt_mesh_hb_cb_list_start SPACE1("._bt_mesh_hb_cb.static.00_start");
203+
__USED const struct bt_mesh_hb_cb _bt_mesh_hb_cb_list_end SPACE1("._bt_mesh_hb_cb.static.zz_end");
204+
__USED const struct bt_mesh_friend_cb _bt_mesh_friend_cb_list_start SPACE1("._bt_mesh_friend_cb.static.00_start");
205+
__USED const struct bt_mesh_friend_cb _bt_mesh_friend_cb_list_end SPACE1("._bt_mesh_friend_cb.static.zz_end");
206+
__USED const struct bt_mesh_proxy_cb _bt_mesh_proxy_cb_list_start SPACE1("._bt_mesh_proxy_cb.static.00_start");
207+
__USED const struct bt_mesh_proxy_cb _bt_mesh_proxy_cb_list_end SPACE1("._bt_mesh_proxy_cb.static.zz_end");
208+
#endif
207209
#endif
208210

209211
/********************FIFO ***********************************************/

0 commit comments

Comments
 (0)