int32 counter;
int32 i;
int8* name;
- U u;
+ G g;
Stktop *stktop;
// store local copy of per-process data block that we can write as we unwind
- mcpy((byte*)&u, (byte*)r15, sizeof(U));
+ mcpy((byte*)&g, (byte*)r15, sizeof(G));
counter = 0;
name = "panic";
callpc = pc;
if((uint8*)_morestack < pc && pc < (uint8*)_endmorestack) {
// call site in _morestack(); pop to earlier stack block to get true caller
- stktop = (Stktop*)u.stackbase;
- u.stackbase = stktop->oldbase;
- u.stackguard = stktop->oldguard;
+ stktop = (Stktop*)g.stackbase;
+ g.stackbase = stktop->oldbase;
+ g.stackguard = stktop->oldguard;
sp = stktop->oldsp;
pc = ((uint8**)sp)[1];
sp += 16; // two irrelevant calls on stack - morestack, plus the call morestack made
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-
/*
* basic types
*/
int32 unused;
void (*fun[])(void);
};
-typedef struct U U;
-struct U
+typedef struct G G;
+struct G
{
byte* stackguard; // must not move
byte* stackbase; // must not move
- U* ufor; // dbl ll of all u
- U* ubak;
- U* runqfor; // dbl ll of runnable
- U* runqbak;
+ G* ufor; // dbl ll of all u
+ G* ubak;
+ G* runqfor; // dbl ll of runnable
+ G* runqbak;
};
typedef struct M M;
struct M
byte* istackguard; // must not move
byte* istackbase; // must not move
};
+extern register G* g; // R15
+extern register M* m; // R14
/*
* global variables
*/
-U* allu;
M* allm;
-U* runq;
+G* allu;
+G* runq;
/*
* defined constants