Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //outputs this error
- //SNCLINK : error : '_gCellFiberPpuThreadLocalStorage' is TLS variable. PRX doesn't support TLS now!
- #include <cell\fiber\ppu_fiber.h>
- #include <cell/fiber/ppuUtilDefine.h>
- #include <cassert>
- #include <cell/fiber/ppuUtilRuntime.h>
- $(SCE_PS3_ROOT)\target\ppu\lib\libfiber_stub.a
- static int fiber_entry_Hello(uint64_t arg)
- {
- printf("Hello, fiber!\n");
- return 0;
- }
- void fiberRun()
- {
- cellFiberPpuInitialize();
- CellFiberPpuScheduler* scheduler = (CellFiberPpuScheduler*)memalign(CELL_FIBER_PPU_SCHEDULER_ALIGN, CELL_FIBER_PPU_SCHEDULER_SIZE);
- CellFiberPpuSchedulerAttribute schedAttr;
- cellFiberPpuSchedulerAttributeInitialize(&schedAttr);
- schedAttr.debuggerSupport = true;
- cellFiberPpuInitializeScheduler(scheduler, &schedAttr);
- CellFiberPpu* fiberHello = (CellFiberPpu*)memalign(CELL_FIBER_PPU_ALIGN, CELL_FIBER_PPU_SIZE);
- void* fiberHelloStack = memalign(CELL_FIBER_PPU_STACK_ALIGN, 2048);
- CellFiberPpuAttribute attr;
- cellFiberPpuAttributeInitialize(&attr);
- strncpy(attr.name, "Sample Hello Fiber", CELL_FIBER_PPU_NAME_MAX_LENGTH);
- cellFiberPpuCreateFiber(scheduler, fiberHello, fiber_entry_Hello, 0ULL, 1, fiberHelloStack, 2048, &attr);
- cellFiberPpuRunFibers(scheduler);
- int status;
- cellFiberPpuJoinFiber(fiberHello, &status);
- free(fiberHello);
- free(fiberHelloStack);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement