Software > Applications and Porting

[DEV] Add ppc64le support for generator-rs - need guidance

(1/1)

tle:
Hi folks

One of main blocker of getting Cosmic Desktop compiled on ppc64le is the generator-rs package. I've lodged a ticket upstream in https://github.com/Xudong-Huang/generator-rs/issues/60

However I do not think the author would get to it. So I am thinking to give it a go myself. Can anyone give me some examples of context-switching registers of POWER ISA?

Many thanks

ClassicHasClass:
If I'm reading https://github.com/Xudong-Huang/generator-rs/blob/master/src/detail/asm/asm_riscv64_c_elf.S correctly, basically what it's asking for is a function prologue to save registers. This must obey the OpenPOWER SysV ABI, so it would be something like

mflr r0
std r0,16(r1)
mfcr r0
std r0,8(r1)
stdu r1,-FRAMESIZE(r1)

and then start saving your callee-saved registers into the frame, which is basically any non-volatile GPRs and FPRs your routine might touch.

Not quite sure what it's doing with the green task routine but I only read the source cursorily.

tle:

--- Quote from: ClassicHasClass on August 10, 2024, 07:52:25 pm ---If I'm reading https://github.com/Xudong-Huang/generator-rs/blob/master/src/detail/asm/asm_riscv64_c_elf.S correctly, basically what it's asking for is a function prologue to save registers. This must obey the OpenPOWER SysV ABI, so it would be something like

mflr r0
std r0,16(r1)
mfcr r0
std r0,8(r1)
stdu r1,-FRAMESIZE(r1)

and then start saving your callee-saved registers into the frame, which is basically any non-volatile GPRs and FPRs your routine might touch.

Not quite sure what it's doing with the green task routine but I only read the source cursorily.

--- End quote ---

From my understanding the RISV asm consists of 3 functions:

* The prefetch function is essentially a no-op function
* The bootstrap_green_task function sets up arguments and then jumps to the address contained in register s4, effectively starting a new task or function.
* The swap_registers function saves the current values of a large number of registers (both general-purpose and floating-point) to memory and then restores them from another memory location

Thanks for show me the OpenPOWER SysV ABI example, let me do a bit homework

Navigation

[0] Message Index

Go to full version