overdrivenpotato / rust-psp

Rust on PSP. Panic and allocation support. Access PSP system libraries.
Other
588 stars 31 forks source link

feat: mark `psp::math` functions as safe #134

Open zetanumbers opened 1 year ago

zetanumbers commented 1 year ago

This is possible due to 9546fa1d2cd6551dbc6aff40852f6b8f6a8f68ba initialization a vfpu enabled thread inside of the module_start. It is unsafe to get outside of vfpu context.

MaxVerevkin commented 1 year ago

But how is 9546fa1d2cd6551dbc6aff40852f6b8f6a8f68ba relevant here? vfpu was enabled before it too.

zetanumbers commented 1 year ago

But how is 9546fa1 relevant here? vfpu was enabled before it too.

Um, yeah. Anyway we discussed this on discord and decided this is an appropriate change.

sajattack commented 1 year ago

But how is 9546fa1 relevant here? vfpu was enabled before it too.

This is where the change actually occurred. Might've been some confusion in our discussion. https://github.com/overdrivenpotato/rust-psp/commit/de9ee9dfd7a060325e8a68f9e72e630d39b2ee77#diff-05072a5ebf71822998be8bb7f33b844dc8b68dcb256562c5291044373a6125faR220

zetanumbers commented 1 year ago

Hm, after some thought i am not sure if we can make these functions safe. What about staticlib, when rust doesn't define module_start?