Re: That's how (why) BSD is dying (Was: BPF64)
Vadim Goncharov <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.network |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 16 Sep 2024 11:15:30 +1000 Simon Burge <[email protected]> wrote: > Vadim Goncharov wrote: > > > And e.g. https://en.wikipedia.org/wiki/MIPS_architecture > > says 2 registers are for kernel - OK, and what if we are kernel > > itself? :-) Do we need Thread Pointer of Global Pointer, or we can > > stash them to stack? Etc. > > Where in that page does it say that a MIPS kernel can only use two > registers? It clearly says that two registers are reserved for kernel > use, but certainly doesn't claim to say that the kernel can only use > two regs. Well, that's my bad wording. I wanted to say, that, a JIT compiler can use N registers for it's needs, where N is get by taking architecture's number of general-purpose registers - and subtracting from them those which are required by platform ABI etc. Amongst those requirements are stack pointer etc. and - on MIPS in userland - two registers are listed "for kernel", so you subtract them, too. But what if we are in MIPS kernel? Now, are those two registers still reserved for something, or can be used by in-kernel JIT ? In other words, is it (on MIPS) N in userland and N+2 in kernel, or not? or...? -- WBR, @nuclight