mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Implement syscall for arm32
This commit is contained in:
@@ -2036,6 +2036,31 @@ lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValue const &tv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case TargetArch_arm32:
|
||||||
|
{
|
||||||
|
// TODO(bill): Check this is correct
|
||||||
|
GB_ASSERT(arg_count <= 7);
|
||||||
|
|
||||||
|
char asm_string[] = "svc #0";
|
||||||
|
gbString constraints = gb_string_make(heap_allocator(), "={r0}");
|
||||||
|
for (unsigned i = 0; i < arg_count; i++) {
|
||||||
|
constraints = gb_string_appendc(constraints, ",{");
|
||||||
|
static char const *regs[] = {
|
||||||
|
"r8",
|
||||||
|
"r0",
|
||||||
|
"r1",
|
||||||
|
"r2",
|
||||||
|
"r3",
|
||||||
|
"r4",
|
||||||
|
"r5",
|
||||||
|
};
|
||||||
|
constraints = gb_string_appendc(constraints, regs[i]);
|
||||||
|
constraints = gb_string_appendc(constraints, "}");
|
||||||
|
}
|
||||||
|
|
||||||
|
inline_asm = llvm_get_inline_asm(func_type, make_string_c(asm_string), make_string_c(constraints));
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
GB_PANIC("Unsupported platform");
|
GB_PANIC("Unsupported platform");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user