mirror of
https://github.com/IllusionMan1212/vitasdk-odin.git
synced 2026-10-24 02:12:38 +00:00
initial
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package fiber
|
||||
|
||||
import "core:c"
|
||||
import sce "../common"
|
||||
|
||||
foreign import _fiber "system:SceFiber_stub"
|
||||
|
||||
@(link_prefix = "sceFiber")
|
||||
foreign _fiber {
|
||||
@(link_name = "_sceFiberInitializeImpl")
|
||||
InitializeImpl :: proc(
|
||||
fiber: ^SceFiber,
|
||||
name: cstring,
|
||||
entry: ^SceFiberEntry,
|
||||
argOnInitialize: sce.UInt32,
|
||||
addrContext: rawptr,
|
||||
sizeContext: sce.Size,
|
||||
params: ^SceFiberOptParam) -> sce.Int32 ---
|
||||
OptParamInitialize :: proc(optParam: ^SceFiberOptParam) -> sce.Int32 ---
|
||||
Finalize :: proc(fiber: ^SceFiber) -> sce.Int32 ---
|
||||
Run :: proc(fiber: ^SceFiber, argOnRunTo: sce.UInt32, argOnRun: ^sce.UInt32) -> sce.Int32 ---
|
||||
Switch :: proc(fiber: ^SceFiber, argOnRunTo: sce.UInt32, argOnRun: ^sce.UInt32) -> sce.Int32 ---
|
||||
GetSelf :: proc(fiber: SceFiber) -> sce.Int32 ---
|
||||
ReturnToThread :: proc(argOnReturn: sce.UInt32, argOnRun: ^sce.UInt32) -> sce.Int32 ---
|
||||
GetInfo :: proc(fiber: ^SceFiber, fiberInfo: ^SceFiberInfo) -> sce.Int32 ---
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package fiber
|
||||
|
||||
import "core:c"
|
||||
import sce "../common"
|
||||
|
||||
// Error Codes
|
||||
|
||||
// TODO: should be c.int
|
||||
SceFiberErrorCode :: enum c.uint {
|
||||
NULL = 0x80590001,
|
||||
ALIGNMENT = 0x80590002,
|
||||
RANGE = 0x80590003,
|
||||
INVALID = 0x80590004,
|
||||
PERMISSION = 0x80590005,
|
||||
STATE = 0x80590006,
|
||||
BUSY = 0x80590007,
|
||||
AGAIN = 0x80590008,
|
||||
FATAL = 0x80590009
|
||||
}
|
||||
|
||||
SceFiber :: struct #align(8) {
|
||||
reserved: [128]c.char,
|
||||
}
|
||||
#assert(size_of(SceFiber) == 0x80)
|
||||
|
||||
SceFiberOptParam :: struct #align(8) {
|
||||
reserved: [128]c.char,
|
||||
}
|
||||
#assert(size_of(SceFiberOptParam) == 0x80)
|
||||
|
||||
SceFiberEntry :: #type proc(argOnInitialize: sce.UInt32, argOnRun: sce.UInt32)
|
||||
|
||||
SceFiberInfo :: struct #align(8) {
|
||||
entry: ^SceFiberEntry,
|
||||
argOnInitialize: sce.UInt32,
|
||||
addrContext: rawptr,
|
||||
sizeContext: sce.Size,
|
||||
name: [32]c.char,
|
||||
padding: [80]c.uint,
|
||||
}
|
||||
when size_of(rawptr) == 4 {
|
||||
#assert(size_of(SceFiberInfo) == 0x170)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user