Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Special yield() variant for thunk'ed functions #19

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

mcspr
Copy link
Contributor

@mcspr mcspr commented Aug 1, 2024

cont_suspend() wants stack pointer to be within cont.stack[] and panic()s otherwise esp8266/Arduino#9170 (comment)

stack_thunk_yield() func then gets added from the Core side, which should do 'SP store -> can_yield && yield() -> SP restore' with known stack thunk values esp8266/Arduino@master...mcspr:esp8266-Arduino:bssl/9170-thunk
(maybe with less inline asm though)

cont_suspend() wants stack pointer to be within cont.stack and panic()s otherwise
esp8266/Arduino#9170 (comment)

stack_thunk_yield() func then gets added from the Core side,
which should do 'SP store -> yield() -> SP restore' with known stack thunk values
esp8266/Arduino@master...mcspr:esp8266-Arduino:bssl/9170-thunk
@mcspr
Copy link
Contributor Author

mcspr commented Aug 8, 2024

ping @earlephilhower

@earlephilhower
Copy link
Owner

Sorry, @mcspr . I must have missed this. I'll build on the rp2040 and then merge this morning my time.

@earlephilhower earlephilhower merged commit f08b38b into earlephilhower:master Aug 8, 2024
@earlephilhower
Copy link
Owner

Are you going to rebuild the 8266 library, or do you want me to do it?

@mcspr
Copy link
Contributor Author

mcspr commented Aug 8, 2024

Are you going to rebuild the 8266 library, or do you want me to do it?

Will build some time later w/ github actions builder, not a problem

@mcspr
Copy link
Contributor Author

mcspr commented Aug 9, 2024

Will build some time later w/ github actions builder, not a problem

Just to verify... Looking at README, build instructions are make CONF=esp8266 & cp esp8266/libbearssl.a to tools/sdk/lib/ with xtensa toolchain in $PATH. Build works, I see the lib file actually changed

https://github.com/mcspr/esp8266-Arduino/blob/bearssl/build-2024_08_09T13_04_00_00/tools/sdk/lib/libbearssl.a

Why there are extra symbols, though? Something wrong with the config or its safe to ignore?

~/.p/p/f/t/s/lib (master) [0|1]> nm -C libbearssl.a | grep br_ec_c25519
         U br_ec_c25519_m15
00000000 R br_ec_c25519_i15
00000000 R br_ec_c25519_m15
~/.p/p/f/t/s/lib (master)> nm -C libbearssl2.a | grep br_ec_c25519
         U br_ec_c25519_m15
         U br_ec_c25519_m31
00000000 R br_ec_c25519_i15
00000000 R br_ec_c25519_i31
00000000 R br_ec_c25519_m15
00000000 R br_ec_c25519_m31
00000000 T br_ec_c25519_m62_get
00000000 T br_ec_c25519_m64_get

And some extra symbols with i31, m31, m62, m64 in names

@mcspr
Copy link
Contributor Author

mcspr commented Aug 9, 2024

Ah, damn. I see tools/sdk/ssl/Makefile now. nvm then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants