aboutsummaryrefslogtreecommitdiff
path: root/common/errors
diff options
context:
space:
mode:
Diffstat (limited to 'common/errors')
-rw-r--r--common/errors/errors.zig3
-rw-r--r--common/errors/memory/allocation.zig9
-rw-r--r--common/errors/memory/mapping.zig11
-rw-r--r--common/errors/memory/memory.zig7
4 files changed, 30 insertions, 0 deletions
diff --git a/common/errors/errors.zig b/common/errors/errors.zig
new file mode 100644
index 0000000..38cd106
--- /dev/null
+++ b/common/errors/errors.zig
@@ -0,0 +1,3 @@
+//! Common Errors
+
+pub const memory = @import("memory/memory.zig");
diff --git a/common/errors/memory/allocation.zig b/common/errors/memory/allocation.zig
new file mode 100644
index 0000000..2359cac
--- /dev/null
+++ b/common/errors/memory/allocation.zig
@@ -0,0 +1,9 @@
+//! Memory Allocation Errors
+
+pub const AllocationError = error{
+ OutOfMemory,
+ InvalidSize,
+ InvalidAlignment,
+ RegionExhausted,
+ ZoneExhausted,
+};
diff --git a/common/errors/memory/mapping.zig b/common/errors/memory/mapping.zig
new file mode 100644
index 0000000..3f24216
--- /dev/null
+++ b/common/errors/memory/mapping.zig
@@ -0,0 +1,11 @@
+//! Memory Mapping Errors
+
+pub const MappingError = error{
+ InvalidAddress,
+ AddressNotAligned,
+ RegionOverlap,
+ PermissionDenied,
+ PageTableAllocationFailed,
+ AlreadyMapped,
+ NotMapped,
+};
diff --git a/common/errors/memory/memory.zig b/common/errors/memory/memory.zig
new file mode 100644
index 0000000..de76bf2
--- /dev/null
+++ b/common/errors/memory/memory.zig
@@ -0,0 +1,7 @@
+//! Memory Errors
+
+pub const allocation = @import("allocation.zig");
+pub const mapping = @import("mapping.zig");
+
+pub const AllocationError = allocation.AllocationError;
+pub const MappingError = mapping.MappingError;