about summary refs log tree commit diff stats
path: root/subx/012elf.cc
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-05-13 17:27:45 -0700
committerKartik Agaram <vc@akkartik.com>2019-05-13 17:56:20 -0700
commit6f6d458fcd619810d657fe3e1b82b4d1970dc2df (patch)
tree445ef65727d4453e9a13a01ecae151da924ccd97 /subx/012elf.cc
parent2b9925c70835b102d26f27f2a32044552d0b6426 (diff)
downloadmu-6f6d458fcd619810d657fe3e1b82b4d1970dc2df.tar.gz
start using the new carry flag
Skimping on tests; the code changes seem pretty trivial. Will this fix
CI?!
Diffstat (limited to 'subx/012elf.cc')
-rw-r--r--subx/012elf.cc23
1 files changed, 10 insertions, 13 deletions
diff --git a/subx/012elf.cc b/subx/012elf.cc
index 0fa9d793..0ae0b108 100644
--- a/subx/012elf.cc
+++ b/subx/012elf.cc
@@ -141,20 +141,17 @@ void load_segment_from_program_header(uint8_t* elf_contents, int segment_index,
 //   code:  0x09000000 -> 0x09ffffff (specified in ELF binary)
 //   data:  0x0a000000 -> 0x0affffff (specified in ELF binary)
 //   --- heap gets mmap'd somewhere here ---
-//   stack: 0x7dffffff -> 0x7d000000 (downward; not in ELF binary)
-//   argv hack: 0x7f000000 -> 0x7fffffff (not in ELF binary)
+//   stack: 0xbdffffff -> 0xbd000000 (downward; not in ELF binary)
+//   argv hack: 0xbf000000 -> 0xbfffffff (not in ELF binary)
 //
-// For now we avoid addresses with the most significant bit set; SubX doesn't
-// support unsigned comparison yet (https://github.com/akkartik/mu/issues/30)
-// Once we do, we can go up to 0xc0000000; higher addresses are reserved for
-// the Linux kernel.
-const int CODE_SEGMENT      = 0x09000000;
-const int DATA_SEGMENT      = 0x0a000000;
-const int START_HEAP        = 0x0b000000;
-const int END_HEAP          = 0x7d000000;
-const int STACK_SEGMENT     = 0x7d000000;
-const int AFTER_STACK       = 0x7e000000;
-const int ARGV_DATA_SEGMENT = 0x7f000000;
+// Addresses above 0xc0000000 are reserved for the Linux kernel.
+const uint32_t CODE_SEGMENT      = 0x09000000;
+const uint32_t DATA_SEGMENT      = 0x0a000000;
+const uint32_t START_HEAP        = 0x0b000000;
+const uint32_t END_HEAP          = 0xbd000000;
+const uint32_t STACK_SEGMENT     = 0xbd000000;
+const uint32_t AFTER_STACK       = 0xbe000000;
+const uint32_t ARGV_DATA_SEGMENT = 0xbf000000;
 // When updating the above memory map, don't forget to update `mmap`'s
 // implementation in the 'syscalls' layer.
 :(before "End Dump Info for Instruction")