summaryrefslogtreecommitdiff
path: root/supervisor
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2019-01-10 11:00:40 -0800
committerScott Shawcroft <scott@tannewt.org>2019-01-10 11:00:40 -0800
commit3dd59c3d5fa59f5bea3acc8e55c4d4a5091e66eb (patch)
tree2f88dec06349002ce2406046ab260a7429a21b3d /supervisor
parentb5e40f52c2b1c2890c866d7305e0e99b4811b7f5 (diff)
Polish thanks to Dan's feedback
Diffstat (limited to 'supervisor')
-rwxr-xr-xsupervisor/memory.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/supervisor/memory.h b/supervisor/memory.h
index 4f8317a2d..c89f14bd9 100755
--- a/supervisor/memory.h
+++ b/supervisor/memory.h
@@ -39,6 +39,8 @@ typedef struct {
uint32_t length; // in bytes
} supervisor_allocation;
+
+
void memory_init(void);
void free_memory(supervisor_allocation* allocation);
supervisor_allocation* allocate_remaining_memory(void);
@@ -48,4 +50,11 @@ supervisor_allocation* allocate_remaining_memory(void);
// statically allocated memory.
supervisor_allocation* allocate_memory(uint32_t length, bool high_address);
+static inline uint16_t align32_size(uint16_t size) {
+ if (size % 4 != 0) {
+ return (size & 0xfffc) + 0x4;
+ }
+ return size;
+}
+
#endif // MICROPY_INCLUDED_SUPERVISOR_MEMORY_H