Date   

ARM Cortex R intermittent MPU memory access check failures with CONFIG_USERSPACE

Phil Erwin Jr
 

I'm getting intermittent run-time failures such as:

     syscall z_hdlr_k_uptime_get failed check: Memory region 0x0002ff70 (size 8) write access denied
     ***** Hardware exception *****
     Current thread ID = 0x000221b0
     Faulting instruction address = 0x1a
     Fatal fault in thread 0x000221b0! Aborting.

In this example, k_uptime_get() was called, which is going to save its 64-bit return value into memory (due to the syscall macros).  The syscall gear is checking to see if the memory
address is valid.  The routines wind down into mpu_buffer_validate(), which will call is_user_accessible_region() and finally into get_region_ap().  The code
is failing because get_region_ap() has a critical code section which is not wrapped with an irq_lock()/irq_unlock().  In this failure, we write the MPU index register, then
take an external interrupt, go off to another thread for a while ( which is going to re-load the MPU entries), return to the current thread (again re-loading the MPU entries), and read the attribute register (for the wrong index) and fail.

In reading the current Cortex-M code, I don't see it protecting these critical sections either, so I'm left wondering if the 'M' class will save the index register during
interrupt processing.  If so, I would like to fix the 'R' code in a similar fashion.

There are several of these utility subroutines with this same critical code sections.

For reference, I've included the diff of get_region_ap() that I am going to be testing with locally where I do irq_lock() and irq_unlock().

 /**
  * This internal function returns the access permissions of an MPU region
  * specified by its region index.
@@ -133,7 +136,17 @@ static inline int is_enabled_region(u32_t index)
  */
 static inline u32_t get_region_ap(u32_t r_index)
 {
-       set_region_number(r_index);
+   int
+      attr,
+      key = irq_lock();
+  
+   set_region_number(r_index);
+  
+   attr = get_region_attributes();
 
-       return (get_region_attributes() & MPU_RASR_AP_Msk) >> MPU_RASR_AP_Pos;
+   irq_unlock(key);
+
+   return (attr & MPU_RASR_AP_Msk) >> MPU_RASR_AP_Pos;
 }
+


Re: Feedback requested on west manifest imports

Bolivar, Marti
 

Hello,

I've cut a new west pre-release today (0.6.99.dev5) which is feature complete for manifest imports.

The main new feature since 0.6.99.dev4 is you can now use whitelists and blacklists to filter what projects you import, with a slight change of plan from the original proposal which is reflected in the documentation.

We'd like to wrap up this west release in the next week or two, so if you have any more feedback, please let us know!

This introductory file is still valid:
https://github.com/mbolivar/my-zephyr-app/blob/master/README.rst

The working documentation build is still here:
https://builds.zephyrproject.org/zephyrproject-rtos/zephyr/20433/docs/guides/west/manifest.html#manifest-imports

You may need to clear your browser cache and reload to get the latest build.

Thanks,
Marti


Re: 回复:回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

Boie, Andrew P
 

Try this instead, this is what I do every day, I never use west as it doesn’t properly support emulators. For x86-64 the host GDB works great:

 

. zephyr-env.sh

cd samples/hello_world

mkdir out

cd out

cmake -DBOARD=qemu_x86_64 ..

make -j32

make debugserver

 

In another terminal:

cd samples/hello_world/out

gdb zephyr/zephyr.elf -ex "target remote :1234"

 

GDB will start up and you can debug as usual.

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Sunday, January 26, 2020 7:54 PM
To: devel <devel@...>; Boie, Andrew P <andrew.p.boie@...>
Subject: 回复:回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you

It seems work seeing the source code, but still has problem on connection:

(gdb) target remote localhost:1234

Remote debugging using localhost:1234

warning: Selected architecture i386:x64-32 is not compatible with reported target architecture i386:x86-64

Remote 'g' packet reply is too long (expected 596 bytes, got 608 bytes): 00000000000000000000000000000000000000000000000063060000000000000000000000000000000000000000000000000000000000000000000000000000000

00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0ff0000000000000200000000f0000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000001000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f0300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

000000000000000000000000000000000000000000000000000000000801f0000

(gdb) 

 

BTW can this debug method view each core of SMP?  how ? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <carles.cufi@...>

发送时间:2020127(星期一) 00:40

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:Re: 回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Hi there,

 

You are right, I made a mistake. Here’s the updated instructions that work for me:

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ /opt/zephyr-sdk/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb build/zephyr/zephyr.elf

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

So it’s a matter of using Zephyr’s SDK gdb and passing it as a parameter the path to build/zephyr/zephyr.elf

 

Carles

 

From:曹子 <caozilong@...>
Sent: 25 January 2020 03:15
To: Cufi, Carles <Carles.Cufi@...>; Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Subject:
回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you!

But it seems cant load the symbol, so how to compile the debug elf files?

BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?

Thread 1 received signal SIGINT, Interrupt.

0x0000000000100dfb in ?? ()

(gdb) bt

#0  0x0000000000100dfb in ?? ()

#1  0x0000000000102e7e in ?? ()

#2  0x0000000000102e5a in ?? ()

#3  0x00000000001004d2 in ?? ()

#4  0x0000000000000000 in ?? ()

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <Carles.Cufi@...>

发送时间:2020124(星期五) 23:53

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From:devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 

 

 


回复:回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

"曹子龙
 

Thank you!
It seems work seeing the source code, but still has problem on connection:
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
warning: Selected architecture i386:x64-32 is not compatible with reported target architecture i386:x86-64
Remote 'g' packet reply is too long (expected 596 bytes, got 608 bytes): 00000000000000000000000000000000000000000000000063060000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0ff0000000000000200000000f0000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000001000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f0300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000000000000801f0000
(gdb) 

BTW, can this debug method view each core of SMP?  how ? thank you!

曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 


------------------------------------------------------------------
发件人:Cufi, Carles <carles.cufi@...>
发送时间:2020年1月27日(星期一) 00:40
收件人:曹子龙 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>
主 题:Re: 回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

Hi there,

 

You are right, I made a mistake. Here’s the updated instructions that work for me:

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ /opt/zephyr-sdk/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb build/zephyr/zephyr.elf

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

So it’s a matter of using Zephyr’s SDK gdb and passing it as a parameter the path to build/zephyr/zephyr.elf

 

Carles

 

From:曹子 <caozilong@...>
Sent: 25 January 2020 03:15
To: Cufi, Carles <Carles.Cufi@...>; Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Subject:
回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you!

But it seems cant load the symbol, so how to compile the debug elf files?

BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?

Thread 1 received signal SIGINT, Interrupt.

0x0000000000100dfb in ?? ()

(gdb) bt

#0  0x0000000000100dfb in ?? ()

#1  0x0000000000102e7e in ?? ()

#2  0x0000000000102e5a in ?? ()

#3  0x00000000001004d2 in ?? ()

#4  0x0000000000000000 in ?? ()

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <Carles.Cufi@...>

发送时间:2020124(星期五) 23:53

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From:devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 

 



Re: GPIO porting status, 26th January

Carles Cufi
 

Hi all,

Peter Bigot is currently working on rebasing the topic-gpio branch against master.
The highest risk right now is the current set of users without a PR, since existing PRs with requested changes can be expedited by taking over the branch if necessary (though it probably won't be).

This is the current status of GPIO user porting as of today (26th January):

Remaining users without a PR:
drivers/ieee802154/ieee802154_cc1200: Tomasz
drivers/ieee802154/ieee802154_cc2520: Tomasz
drivers/ieee802154/ieee802154_mcr20a: Johann
drivers/ieee802154/ieee802154_rf2xx*.c: Piotr
drivers/eeprom/eeprom_at2x: Peter
drivers/lora: Peter

Remaining users with PR but requiring reviews:
drivers/audio/tlv320dac310x: https://github.com/zephyrproject-rtos/zephyr/pull/22172 (approved, will be merged after rebase)
drivers/sensor/bma280: https://github.com/zephyrproject-rtos/zephyr/pull/22104: Peter (requires rebase, in progress)

Remaining users with PR but requiring rework of the PR:
drivers/wifi/winc1500: https://github.com/zephyrproject-rtos/zephyr/pull/22156: Tomasz
samples/drivers/espi: https://github.com/zephyrproject-rtos/zephyr/pull/22154: Alberto

All reviews and rework of existing PRs are very welcome.

See the full overview here:
https://github.com/zephyrproject-rtos/zephyr/issues/20017

Regards,

Carles

-----Original Message-----
From: Cufi, Carles
Sent: 24 January 2020 19:13
To: devel <devel@lists.zephyrproject.org>; Johann Fischer
<j.fischer@phytec.de>; Maureen Helm <maureen.helm@nxp.com>; Kumar Gala
<kumar.gala@linaro.org>; Bigot, Peter <Peter.Bigot@nordicsemi.no>;
Bursztyka, Tomasz <tomasz.bursztyka@intel.com>; Piotr Mienkowski
<piotr.mienkowski@gmail.com>; Erwan Gouriou <erwan.gouriou@linaro.org>;
jose.a.meza.arellano@intel.com; Głąbek, Andrzej
<Andrzej.Glabek@nordicsemi.no>
Cc: Hedberg, Johan <johan.hedberg@intel.com>; Nashif, Anas
<anas.nashif@intel.com>
Subject: GPIO porting status, 24th January

[resending this email with the mailing list included to increase
distribution]

Hi all,

This is the current status of GPIO user porting as of today (24th
January):

Remaining users without a PR:
drivers/ieee802154/ieee802154_cc1200: Tomasz
drivers/ieee802154/ieee802154_cc2520: Tomasz
drivers/ieee802154/ieee802154_mcr20a: Johann
drivers/ieee802154/ieee802154_rf2xx*.c: Piotr

Remaining users with PR but requiring reviews:
drivers/audio/tlv320dac310x: https://github.com/zephyrproject-
rtos/zephyr/pull/22172
drivers/display/mb_display.c: https://github.com/zephyrproject-
rtos/zephyr/pull/22157
drivers/modem: https://github.com/zephyrproject-rtos/zephyr/pull/22168
samples/bluetooth/hci_spi: https://github.com/zephyrproject-
rtos/zephyr/pull/22134
samples/boards/nrf52/mesh/*: https://github.com/zephyrproject-
rtos/zephyr/pull/22129
samples/boards/reel_board/mesh_badge: https://github.com/zephyrproject-
rtos/zephyr/pull/22137
drivers/wifi/winc1500: https://github.com/zephyrproject-
rtos/zephyr/pull/22156
samples/sensor/fxos8700-hid: https://github.com/zephyrproject-
rtos/zephyr/pull/22139
tests/bluetooth/mesh: https://github.com/zephyrproject-
rtos/zephyr/pull/22162

Remaining users with PR but requiring rework of the PR:
drivers/display/ssd16xx: https://github.com/zephyrproject-
rtos/zephyr/pull/21686: Johann
samples/drivers/espi: https://github.com/zephyrproject-
rtos/zephyr/pull/22154: Alberto
drivers/sensor/bma280: https://github.com/zephyrproject-
rtos/zephyr/pull/22104: Peter (requires rebase)
drivers/sensor/mpu6050: https://github.com/zephyrproject-
rtos/zephyr/pull/21566: Peter

All reviews and rework of existing PRs are very welcome.

See the full overview here:
https://github.com/zephyrproject-rtos/zephyr/issues/20017

Regards,

Carles


Re: 回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

Carles Cufi
 

Hi there,

 

You are right, I made a mistake. Here’s the updated instructions that work for me:

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ /opt/zephyr-sdk/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gdb build/zephyr/zephyr.elf

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

So it’s a matter of using Zephyr’s SDK gdb and passing it as a parameter the path to build/zephyr/zephyr.elf

 

Carles

 

From: 曹子 <caozilong@...>
Sent: 25 January 2020 03:15
To: Cufi, Carles <Carles.Cufi@...>; Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Subject:
回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thank you!

But it seems cant load the symbol, so how to compile the debug elf files?

BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?

Thread 1 received signal SIGINT, Interrupt.

0x0000000000100dfb in ?? ()

(gdb) bt

#0  0x0000000000100dfb in ?? ()

#1  0x0000000000102e7e in ?? ()

#2  0x0000000000102e5a in ?? ()

#3  0x00000000001004d2 in ?? ()

#4  0x0000000000000000 in ?? ()

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Cufi, Carles <Carles.Cufi@...>

发送时间:2020124(星期五) 23:53

收件人:曹子 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From: devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 

 


Re: why no matches found in "west build -t menuconfig" during find "CONFIG_THREAD_NAME" flag?

Ulf Magnusson
 

Hello,

Skip the 'CONFIG_' prefix when searching for symbols in menuconfig. 'CONFIG_' is just added on output.

Can also search for e.g. "thread name" btw. The search function isn't case-sensitive, and putting in many space-separated strings will list symbols/choices/menus that match all of them.

Cheers,
Ulf

On Sun, Jan 26, 2020 at 3:39 AM "曹子龙 <caozilong@...> wrote:
See blow picture, i try to enable the flag "CONFIG_THREAD_NAME" because it was disabled by default, but still cant see the configuration items in menuconfig, 
can anyone tell me why?

曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 



why no matches found in "west build -t menuconfig" during find "CONFIG_THREAD_NAME" flag?

"曹子龙
 

See blow picture, i try to enable the flag "CONFIG_THREAD_NAME" because it was disabled by default, but still cant see the configuration items in menuconfig, 
can anyone tell me why?

曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 



回复:回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

"曹子龙
 

Thank you!
But it seems cant load the symbol, so how to compile the debug elf files?
BTW: there are two elf files exist in build dir, zephyr.elf and zepyhr-qemu.elf, what is the difference?
Thread 1 received signal SIGINT, Interrupt.
0x0000000000100dfb in ?? ()
(gdb) bt
#0  0x0000000000100dfb in ?? ()
#1  0x0000000000102e7e in ?? ()
#2  0x0000000000102e5a in ?? ()
#3  0x00000000001004d2 in ?? ()
#4  0x0000000000000000 in ?? ()


曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 


------------------------------------------------------------------
发件人:Cufi, Carles <Carles.Cufi@...>
发送时间:2020年1月24日(星期五) 23:53
收件人:曹子龙 <caozilong@...>; "Boie, Andrew P" <andrew.p.boie@...>; devel <devel@...>
主 题:RE: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From: devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From:devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 



GPIO porting status, 24th January

Carles Cufi
 

[resending this email with the mailing list included to increase distribution]

Hi all,

This is the current status of GPIO user porting as of today (24th January):

Remaining users without a PR:
drivers/ieee802154/ieee802154_cc1200: Tomasz
drivers/ieee802154/ieee802154_cc2520: Tomasz
drivers/ieee802154/ieee802154_mcr20a: Johann
drivers/ieee802154/ieee802154_rf2xx*.c: Piotr

Remaining users with PR but requiring reviews:
drivers/audio/tlv320dac310x: https://github.com/zephyrproject-rtos/zephyr/pull/22172
drivers/display/mb_display.c: https://github.com/zephyrproject-rtos/zephyr/pull/22157
drivers/modem: https://github.com/zephyrproject-rtos/zephyr/pull/22168
samples/bluetooth/hci_spi: https://github.com/zephyrproject-rtos/zephyr/pull/22134
samples/boards/nrf52/mesh/*: https://github.com/zephyrproject-rtos/zephyr/pull/22129
samples/boards/reel_board/mesh_badge: https://github.com/zephyrproject-rtos/zephyr/pull/22137
drivers/wifi/winc1500: https://github.com/zephyrproject-rtos/zephyr/pull/22156
samples/sensor/fxos8700-hid: https://github.com/zephyrproject-rtos/zephyr/pull/22139
tests/bluetooth/mesh: https://github.com/zephyrproject-rtos/zephyr/pull/22162

Remaining users with PR but requiring rework of the PR:
drivers/display/ssd16xx: https://github.com/zephyrproject-rtos/zephyr/pull/21686: Johann
samples/drivers/espi: https://github.com/zephyrproject-rtos/zephyr/pull/22154: Alberto
drivers/sensor/bma280: https://github.com/zephyrproject-rtos/zephyr/pull/22104: Peter (requires rebase)
drivers/sensor/mpu6050: https://github.com/zephyrproject-rtos/zephyr/pull/21566: Peter

All reviews and rework of existing PRs are very welcome.

See the full overview here:
https://github.com/zephyrproject-rtos/zephyr/issues/20017

Regards,

Carles


Re: 回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

Carles Cufi
 

$ cd ~/zephyrproject/zephyr

$ source zephyr-env.sh

$ west build -b qemu_x86_64 samples/hello_world/

$ cd build/

$ ninja debugserver

 

and then in another terminal

 

$ gdb

(gdb) target remote localhost:1234

(gdb) dir ~/zephyrproject/zephyr/

(gdb) continue

 

See https://docs.zephyrproject.org/latest/application/index.html#id1

 

 

From: devel@... <devel@...> On Behalf Of "??? via Lists.Zephyrproject.Org
Sent: 24 January 2020 07:36
To: Boie, Andrew P <andrew.p.boie@...>; devel <devel@...>
Cc: devel@...
Subject:
回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

Thanks

 

Can it be debuged by GDB? how to with west? 

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Boie, Andrew P <andrew.p.boie@...>

发送时间:2020124(星期五) 02:37

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 


Zephyr 2.2 release schedule

Johan Hedberg
 

Hi,

I’d like to remind everyone of the current release schedule for the next Zephyr release, i.e. version 2.2:

- The feature merge window is open for roughly two more weeks, closing on February 7th. Any new features or enhancements that are desired for the release need to be merged to master by this time.

- If you have any unsent feature pull requests please don’t hesitate to send them, since the review process can often take a substantial amount of time.

- The final release of Zephyr 2.2 is targeted for February 28th.

More information on the various milestones and planned release schedules can be found here:
https://github.com/zephyrproject-rtos/zephyr/wiki/Program-Management

The release plan of major features for each release is managed here:
https://github.com/zephyrproject-rtos/zephyr/projects/9

Thanks!

Johan


回复:[Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

"曹子龙
 

Thanks

Can it be debuged by GDB? how to with west? 


曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 


------------------------------------------------------------------
发件人:Boie, Andrew P <andrew.p.boie@...>
发送时间:2020年1月24日(星期五) 02:37
收件人:曹子龙 <caozilong@...>; devel <devel@...>
主 题:RE: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 



Race Condition in ATT #ble #nrf52480

ben.byers@...
 
Edited

In version 1.14.1, there appears to be a race condition when updating an indication value. It results in a BUS FAULT, which occurs because a pointer becomes null.
Here are the Zephyr ATT print messages for what it looks like when it breaks:
 
Updating indication value to: 0x02 -- This is an assertion from our code for clarity
[00:00:15.622,406] <dbg> bt_att.bt_att_req_send: conn 0x2000076c req 0x200025d4
[00:00:15.622,406] <dbg> bt_att.att_send_req: req 0x200025d4
[00:00:15.666,259] <dbg> bt_att.att_rsp_sent: conn 0x2000076c att 0x200008a0
[00:00:15.666,351] <dbg> bt_att.bt_att_recv: Received ATT code 0x12 len 13
[00:00:15.666,351] <dbg> bt_att.att_write_req: handle 0x0017
[00:00:15.666,381] <dbg> bt_att.write_cb: handle 0x0017 offset 0

These are the Zephyr messages when it is successful:
Updating indication value to: 0x02
[00:00:20.676,361] <dbg> bt_att.bt_att_req_send: conn 0x2000076c req 0x200025d4
[00:00:20.676,361] <dbg> bt_att.att_send_req: req 0x200025d4
[00:00:20.720,703] <dbg> bt_att.att_rsp_sent: conn 0x2000076c att 0x200008a0
[00:00:20.765,014] <dbg> bt_att.att_req_sent: conn 0x2000076c att 0x200008a0 att->req 0x200025d4
[00:00:20.765,655] <dbg> bt_att.bt_att_recv: Received ATT code 0x1e len 0
[00:00:20.765,686] <dbg> bt_att.att_confirm: 
[00:00:20.765,686] <dbg> bt_att.att_handle_rsp: err 0 len 0: 

It would appear that att_req_sent doesn't get called when the BUS FAULT occurs. This appears consistent when I have repeated this. The ATT code shows that a Write_Request is occurring which looks like it is interrupting the indication update before it finishes. I took some BLE sniffer logs and in both the case of failure and success, the logs look identical, so externally the indication has been sent, but something internally hasn't resolved.

I've tried enabling kernel messages to see if there is a task switch here (including ISR), but I end up with lots of missed messages, so they aren't useful.

Any ideas as to how to fix this or other messages I can enable that will help continue to debug this?

UPDATE: Some more info, I enabled the __ASSERT() and this is what I see:

ASSERTION FAIL [req->func] @ ../ZEPHYR/subsys/bluetooth/host/att.c:267


SDK 0.11.0 Release

Kumar Gala
 

Hi,

Latest version of the SDK can be found here:

https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.11.0

Please download and try things out and report any issues.

General:

• Replaced riscv32 tools with multilib for riscv64 toolchain
• Dropped package of MIPS toolchain at this point
• Removed x86 IAMCU toolchain
• Improved install process / packaging of tools
• can get individual arch toolchains
• don't need to install as root
• prompt for setting up env for you
• Replaced multiple x86 toolchains with single x86_64 toolchain for 32 & 64-bit
• Improve support for building on Ubuntu 18.04 host
• ARM aarch64 support
• Added SPARC support [experimental]
OpenOCD:

• Bump baseline to 20200116
• Removed support for Quark
• Various ARC fixes/updates
QEMU:

• Bump to version 4.2.0
• Pull in Xilinx Cortex-R support
• Pull in LEON2 SPARC support
GCC:

• Bumped to GCC 9.2.0
Host Tools:

• Removed sound-open-firmware-tools as it wasnt used
NEWLIB:

• Added nano-variant builds
• Enabled long-long support in full newlib build
• Support newlib retargetable locking configuration

Thanks to all that contributed fixes and enhancements to this version of the SDK.

- k


Re: Use of k_work_submit_to_user_queue() with CONFIG_USERSPACE

Boie, Andrew P
 

This is a bug. I’ll spend some time on this today and get a GH issue opened.

 

Andrew

 

From: devel@... <devel@...> On Behalf Of phil.erwin@...
Sent: Thursday, January 23, 2020 9:14 AM
To: devel@...
Subject: [Zephyr-devel] Use of k_work_submit_to_user_queue() with CONFIG_USERSPACE

 

I have a work Q that will run in user state and attempting to send work to it.  This results in intermittent failures.  The issue I see
in my current test is that I have taken an interrupt while _current is the idle task.  The idle task has no resource pool, so the
'temporary memory allocation' fails.  No work request is saved.

It seems wrong to me that this API is making an allocation based upon the current thread, and is usable from interrupt handlers.
Every thread in the system would need a resource pool to allocate from.

Am I missing something here?

Phil


/**
 * @brief Submit a work item to a user mode workqueue
 *
 * Submits a work item to a workqueue that runs in user mode. A temporary
 * memory allocation is made from the caller's resource pool which is freed
 * once the worker thread consumes the k_work item. The workqueue
 * thread must have memory access to the k_work item being submitted. The caller
 * must have permission granted on the work_q parameter's queue object.
 *
 * Otherwise this works the same as k_work_submit_to_queue().
 *
 * @note Can be called by ISRs.
 *
 * @param work_q Address of workqueue.
 * @param work Address of work item.
 *
 * @retval -EBUSY if the work item was already in some workqueue
 * @retval -ENOMEM if no memory for thread resource pool allocation
 * @retval 0 Success
 * @req K-WORK-001
 */
static inline int k_work_submit_to_user_queue(struct k_work_q *work_q,
                          struct k_work *work)
{
    int ret = -EBUSY;

    H


Re: is there any gudeline on how to run SMP mode kernel on X86 architecture?

Boie, Andrew P
 

The qemu_x86_64 target is configured to use two cores and SMP by default.

 

Regards,

Andrew

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Thursday, January 23, 2020 3:36 AM
To: devel <devel@...>
Subject: [Zephyr-devel] is there any gudeline on how to run SMP mode kernel on X86 architecture?

 

 

Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.

so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 


Use of k_work_submit_to_user_queue() with CONFIG_USERSPACE

Phil Erwin Jr
 

I have a work Q that will run in user state and attempting to send work to it.  This results in intermittent failures.  The issue I see
in my current test is that I have taken an interrupt while _current is the idle task.  The idle task has no resource pool, so the
'temporary memory allocation' fails.  No work request is saved.

It seems wrong to me that this API is making an allocation based upon the current thread, and is usable from interrupt handlers.
Every thread in the system would need a resource pool to allocate from.

Am I missing something here?

Phil


/**
 * @brief Submit a work item to a user mode workqueue
 *
 * Submits a work item to a workqueue that runs in user mode. A temporary
 * memory allocation is made from the caller's resource pool which is freed
 * once the worker thread consumes the k_work item. The workqueue
 * thread must have memory access to the k_work item being submitted. The caller
 * must have permission granted on the work_q parameter's queue object.
 *
 * Otherwise this works the same as k_work_submit_to_queue().
 *
 * @note Can be called by ISRs.
 *
 * @param work_q Address of workqueue.
 * @param work Address of work item.
 *
 * @retval -EBUSY if the work item was already in some workqueue
 * @retval -ENOMEM if no memory for thread resource pool allocation
 * @retval 0 Success
 * @req K-WORK-001
 */
static inline int k_work_submit_to_user_queue(struct k_work_q *work_q,
                          struct k_work *work)
{
    int ret = -EBUSY;

    H


is there any gudeline on how to run SMP mode kernel on X86 architecture?

"曹子龙
 


Now SMP only supported on xtensa, arc and x86 arch, but it seems more diffculte to run on xtensa and arc becasue of no boards.
so anybody can tell me how to launch a smp run environment on x86 arch? thank you!

曹子龙

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 



Re: 回复:回复:[Zephyr-devel] Is this a bug? how to guarantee the "atomic semantics access of readyqueue" in "do_swap" function during context switch in SMP mode?

Boie, Andrew P
 

Hi there,

 

Race conditions for SMP are still under investigation. We found one today where the same thread object was being scheduled on two cores. Additional eyes on this (or patches) are greatly valued, please feel free to join the discussion in https://github.com/zephyrproject-rtos/zephyr/issues/21317 where are are tracking these SMP issues.

 

Regards,

Andrew

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Wednesday, January 22, 2020 9:54 PM
To: Williams, Jennifer M <jennifer.m.williams@...>; Ross, Andrew J <andrew.j.ross@...>; devel <devel@...>
Subject: 回复:回复:[Zephyr-devel] Is this a bug? how to guarantee the "atomic semantics access of readyqueue" in "do_swap" function during context switch in SMP mode?

 

HI folks:

  

   i still belive there are race conditions exist.

 

in "do_swap" function, what would happen if others cpus pick up the "old" thread to run before  it do the actual context backup?

because if "is_spinlock" set to 1,  there are no others condition to prevent others cpus access the readyqueue,

how to deal with this?

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Williams, Jennifer M <jennifer.m.williams@...>

发送时间:2020123(星期四) 02:43

收件人:曹子 <caozilong@...>; "Ross, Andrew J" <andrew.j.ross@...>; devel <devel@...>

主 题:RE: 回复:[Zephyr-devel] Is this a bug? how to guarantee the "atomic semantics access of readyqueue" in "do_swap" function during context switch in SMP mode?

 

Hi

The PR mentioned below (https://github.com/zephyrproject-rtos/zephyr/pull/21903) was merged yesterday – please review the comments and code changes for more details on the fix. Can you please describe a bit more how your potential issue is not addressed by this PR?

 

Thank you,

Jen

 

From: devel@... <devel@...> On Behalf Of "???
Sent: Tuesday, January 21, 2020 10:31 PM
To: Ross, Andrew J <andrew.j.ross@...>; devel <devel@...>
Subject:
回复:[Zephyr-devel] Is this a bug? how to guarantee the "atomic semantics access of readyqueue" in "do_swap" function during context switch in SMP mode?

 

Hi andy:

 

     so, this is turely a issue that i have illustrated in last emai? is that true?

so the mainline code still has this issue, right?

 

 thank you.

 

 

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

------------------------------------------------------------------

发件人:Andy Ross <andrew.j.ross@...>

发送时间:2020121(星期二) 22:45

收件人:曹子 <caozilong@...>; devel <devel@...>

主 题:Re: [Zephyr-devel] Is this a bug? how to guarantee the "atomic semantics access of readyqueue" in "do_swap" function during context switch in SMP mode?

 

There is a fix for exactly this race this in https://github.com/zephyrproject-rtos/zephyr/pull/21903

On 1/21/2020 1:49 AM, "曹子 wrote:

HI folks:

     if from the call pass of z_swap, which with parameter,  

      do_swap(key.key, lock, 1);

    because is_spinlock is 1, so the lock would be released before invoke the actual switch function "arch_switch", 

which means there are nothing procteced the readyqueue of the scheduler, during the moment, if other cpus access the readyqueue, there would be a chance that

"_current" task be selected by other cpus before the register  context do the actual backup. so did this a bug?

 40 static ALWAYS_INLINE unsigned int do_swap(unsigned int key,

 41                                         ¦ struct k_spinlock *lock,

 42                                         ¦ int is_spinlock)

 43 {                   

 44         ARG_UNUSED(lock);

 45         struct k_thread *new_thread, *old_thread;

 46                     

 47 #ifdef CONFIG_EXECUTION_BENCHMARKING

 48         extern void read_timer_start_of_swap(void);

 49         read_timer_start_of_swap();

 50 #endif              

 51                     

 52         old_thread = _current;

 53                     

 54         z_check_stack_sentinel();

 55                     

 56         if (is_spinlock) {

 57                 k_spin_release(lock);

 58         }           

 59                     

 60         new_thread = z_get_next_ready_thread();

 61                     

 62         if (new_thread != old_thread) {

 63                 sys_trace_thread_switched_out();

 64 #ifdef CONFIG_TIMESLICING

 65                 z_reset_time_slice();

 66 #endif              

 67                     

 68                 old_thread->swap_retval = -EAGAIN;

 69                     

 70 #ifdef CONFIG_SMP   

 71                 _current_cpu->swap_ok = 0;

 72                     

 73                 new_thread->base.cpu = arch_curr_cpu()->id;

 74                     

 75                 if (!is_spinlock) {

 76                         z_smp_release_global_lock(new_thread);

 77                 }   

 78 #endif              

 79                 _current = new_thread;

 80                 arch_switch(new_thread->switch_handle,

 81                         ¦   ¦&old_thread->switch_handle); 84         }          

 85         

 83                 sys_trace_thread_switched_in();

 84         }          

 85         

 86         if (is_spinlock) {

 87                 arch_irq_unlock(key);

 88         } else {   

 89                 irq_unlock(key);

 90         }

 91                    

 92         return _current->swap_retval;

 93 }

 94       

曹子

珠海全志科技股份有限公司      BU1-PSW

地址:广东省珠海市高新区唐家湾镇科技2路9号

TEL:13824125580

Email:caozilong@...

网址: http://www.allwinnertech.com

 

 

 

 

1121 - 1140 of 7807