includes/std: Added section functions

This commit is contained in:
Nik
2022-11-09 21:53:31 +01:00
committed by GitHub
parent 10fdf94899
commit 764b86acc9

View File

@@ -2,6 +2,8 @@
namespace std::mem {
using Section = u128;
enum Endian : u8 {
Native = 0,
Big = 1,
@@ -48,6 +50,28 @@ namespace std::mem {
};
fn create_section(str name) {
return builtin::std::mem::create_section(name);
};
fn delete_section(Section section) {
builtin::std::mem::delete_section(section);
};
fn get_section_size(Section section) {
return builtin::std::mem::get_section_size(section);
};
fn copy_section_to_section(Section from_section, u64 from_address, Section to_section, u64 to_address, u64 size) {
return builtin::std::mem::get_section_size(from_section, from_address, to_section, to_address, size);
};
fn copy_value_to_section(ref auto value, Section to_section, u64 to_address) {
return builtin::std::mem::copy_value_to_section(value, to_section, to_address);
};
struct MagicSearch<auto Magic, T> {
if ($ < (std::mem::size() - std::string::length(Magic) - 1)) {
char __potentialMagic__[std::string::length(Magic)] [[hidden, no_unique_address]];