mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.Target: add psp os
This commit is contained in:
+18
-2
@@ -53,6 +53,7 @@ pub const Os = struct {
|
||||
ps3,
|
||||
ps4,
|
||||
ps5,
|
||||
psp,
|
||||
vita,
|
||||
|
||||
emscripten,
|
||||
@@ -194,6 +195,7 @@ pub const Os = struct {
|
||||
|
||||
.@"3ds",
|
||||
|
||||
.psp,
|
||||
.vita,
|
||||
|
||||
.wasi,
|
||||
@@ -612,6 +614,13 @@ pub const Os = struct {
|
||||
},
|
||||
},
|
||||
|
||||
.psp => .{
|
||||
.semver = .{
|
||||
.min = .{ .major = 1, .minor = 0, .patch = 0 },
|
||||
.max = .{ .major = 6, .minor = 61, .patch = 0 },
|
||||
},
|
||||
},
|
||||
|
||||
.vita => .{
|
||||
.semver = .{
|
||||
// 1.3 is the first public release
|
||||
@@ -919,6 +928,7 @@ pub const Abi = enum {
|
||||
.tvos,
|
||||
.visionos,
|
||||
.watchos,
|
||||
.psp,
|
||||
.ps3,
|
||||
.ps4,
|
||||
.ps5,
|
||||
@@ -2023,7 +2033,10 @@ pub const Cpu = struct {
|
||||
.lanai => &lanai.cpu.v11, // clang does not have a generic lanai model.
|
||||
.loongarch64 => &loongarch.cpu.la64v1_0,
|
||||
.m68k => &m68k.cpu.M68000,
|
||||
.mips, .mipsel => &mips.cpu.mips32r2,
|
||||
.mips, .mipsel => switch (os.tag) {
|
||||
.psp => &mips.cpu.mips2, // mips2 with some custom instructions, no trap instructions
|
||||
else => &mips.cpu.mips32r2,
|
||||
},
|
||||
.mips64, .mips64el => &mips.cpu.mips64r2,
|
||||
.msp430 => &msp430.cpu.msp430,
|
||||
.nvptx, .nvptx64 => &nvptx.cpu.sm_52,
|
||||
@@ -2204,6 +2217,7 @@ pub fn requiresLibC(target: *const Target) bool {
|
||||
.amdhsa,
|
||||
.ps4,
|
||||
.ps5,
|
||||
.psp,
|
||||
.vita,
|
||||
.mesa3d,
|
||||
.contiki,
|
||||
@@ -2379,6 +2393,7 @@ pub const DynamicLinker = struct {
|
||||
.ps3,
|
||||
.ps4,
|
||||
.ps5,
|
||||
.psp,
|
||||
.vita,
|
||||
=> .none,
|
||||
};
|
||||
@@ -2783,6 +2798,7 @@ pub const DynamicLinker = struct {
|
||||
|
||||
.@"3ds",
|
||||
|
||||
.psp,
|
||||
.vita,
|
||||
|
||||
.emscripten,
|
||||
@@ -3338,7 +3354,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
|
||||
.longlong, .ulonglong, .double => return 64,
|
||||
.longdouble => return 80,
|
||||
},
|
||||
.vita => switch (c_type) {
|
||||
.psp, .vita => switch (c_type) {
|
||||
.char => return 8,
|
||||
.short, .ushort => return 16,
|
||||
.int, .uint, .float => return 32,
|
||||
|
||||
@@ -805,6 +805,11 @@ const page_size_min_default: ?usize = switch (builtin.os.tag) {
|
||||
.x86, .x86_64 => 16 << 10,
|
||||
else => null,
|
||||
},
|
||||
.psp => switch (builtin.cpu.arch) {
|
||||
// minimum block allocation by testing sceKernel
|
||||
.mips, .mipsel => 1 << 8, // 256
|
||||
else => null,
|
||||
},
|
||||
// system/lib/libc/musl/arch/emscripten/bits/limits.h
|
||||
.emscripten => 64 << 10,
|
||||
.linux => switch (builtin.cpu.arch) {
|
||||
@@ -963,6 +968,11 @@ const page_size_max_default: ?usize = switch (builtin.os.tag) {
|
||||
.x86, .x86_64 => 16 << 10,
|
||||
else => null,
|
||||
},
|
||||
.psp => switch (builtin.cpu.arch) {
|
||||
// minimum block allocation by testing sceKernel
|
||||
.mips, .mipsel => 1 << 8, // 256
|
||||
else => null,
|
||||
},
|
||||
// system/lib/libc/musl/arch/emscripten/bits/limits.h
|
||||
.emscripten => 64 << 10,
|
||||
.linux => switch (builtin.cpu.arch) {
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ comptime {
|
||||
// case it's not required to provide an entrypoint such as main.
|
||||
if (!@hasDecl(root, start_sym_name) and @hasDecl(root, "main")) @export(&wasm_freestanding_start, .{ .name = start_sym_name });
|
||||
} else switch (native_os) {
|
||||
.other, .freestanding, .@"3ds", .vita => {},
|
||||
.other, .freestanding, .@"3ds", .psp, .vita => {},
|
||||
else => if (!@hasDecl(root, start_sym_name)) @export(&_start, .{ .name = start_sym_name }),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6420,6 +6420,7 @@ fn addCommonCCArgs(
|
||||
.illumos => try argv.append("__illumos__"),
|
||||
// Homebrew targets without LLVM support; use communities's preferred macros.
|
||||
.@"3ds" => try argv.append("-D__3DS__"),
|
||||
.psp => try argv.append("-D__PSP__"),
|
||||
.vita => try argv.append("-D__vita__"),
|
||||
else => {},
|
||||
}
|
||||
|
||||
@@ -247,6 +247,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8
|
||||
.opengl,
|
||||
.other,
|
||||
.plan9,
|
||||
.psp,
|
||||
.vita,
|
||||
=> "unknown",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user