ref: 6ab5327d1ac3a50af584224dc3e563ff24bd36ae
parent: 085bc82e05255be82f47000b850235afaae64d9e
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Jul 6 09:07:02 EDT 2025
kernel: wrap resrcwait() in waserror() for FPsave/FPalloc resrcwait() can error() when interrupted, so wrap the resrcwait() call in a if(!waserror()) ... poperror();
--- a/sys/src/9/arm64/fpu.c
+++ b/sys/src/9/arm64/fpu.c
@@ -54,7 +54,10 @@
while((a = mallocalign(sizeof(FPalloc), 16, 0, 0)) == nil){
int x = spllo();
- resrcwait("no memory for FPalloc");
+ if(up != nil && !waserror()){
+ resrcwait("no memory for FPalloc");
+ poperror();
+ }
splx(x);
}
a->link = link;
--- a/sys/src/9/bcm/vfp3.c
+++ b/sys/src/9/bcm/vfp3.c
@@ -219,7 +219,10 @@
FPalloc *f;
while((f = mallocalign(sizeof(FPalloc), 16, 0, 0)) == nil){
int x = spllo();
- resrcwait("no memory for FPalloc");
+ if(!waserror()){
+ resrcwait("no memory for FPalloc");
+ poperror();
+ }
splx(x);
}
return f;
--- a/sys/src/9/pc/fpu.c
+++ b/sys/src/9/pc/fpu.c
@@ -231,7 +231,10 @@
while((a = mallocalign(sizeof(FPalloc), FPalign, 0, 0)) == nil){
int x = spllo();
- resrcwait("no memory for FPalloc");
+ if(!waserror()){
+ resrcwait("no memory for FPalloc");
+ poperror();
+ }
splx(x);
}
a->link = link;
--- a/sys/src/9/pc64/fpu.c
+++ b/sys/src/9/pc64/fpu.c
@@ -250,7 +250,10 @@
while((a = mallocalign(sizeof(FPalloc), FPalign, 0, 0)) == nil){
int x = spllo();
- resrcwait("no memory for FPalloc");
+ if(up != nil && !waserror()){
+ resrcwait("no memory for FPalloc");
+ poperror();
+ }
splx(x);
}
a->link = link;
--- a/sys/src/9/zynq/trap.c
+++ b/sys/src/9/zynq/trap.c
@@ -112,7 +112,10 @@
while((f = mallocalign(sizeof(FPsave), FPalign, 0, 0)) == nil){
int x = spllo();
- resrcwait("no memory for FPsave");
+ if(!waserror()){
+ resrcwait("no memory for FPsave");
+ poperror();
+ }
splx(x);
}
return f;
--
⑨