From 546a92985f7da2491077d641a2c118b4af7f6913 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 22 Mar 2020 12:11:49 -0700 Subject: start migrating handles to fat pointers CI will fail from this commit onward. Currently working: $ bootstrap translate init.linux 0[4-7]*.subx 080zero-out.subx -o a.elf && ./a.elf test $ bootstrap run a.elf test $ chmod +x a.elf; ./a.elf test Plan: migrate functions that used to return handles to pass in a new arg of type (addr handle). That's a bit of a weird type. There should be few of these functions. (Open question: do we even want to expose this type in the Mu language?) Functions that just need to read from heap without modifying the handle will receive `(addr T)` or `(handle T)` types as arguments. As I sanitize each new file, I need to update signatures for any new functions and add them to a list. I also need to update calls to any functions on the list. --- mu-init.subx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mu-init.subx') diff --git a/mu-init.subx b/mu-init.subx index 2377822e..74d90b7a 100644 --- a/mu-init.subx +++ b/mu-init.subx @@ -27,9 +27,13 @@ $Entry:initialize-args: 8b/-> *esi 2/r32/edx # argc is in words; convert it to bytes c1/shift 4/subop/left %edx 2/imm8 + # var tmp/eax: handle + 68/push 0/imm32 + 68/push 0/imm32 + 89/<- %eax 4/r32/esp # var args/edi: (addr array (addr array byte)) - (allocate-array Heap %edx) # => eax - 89/<- %edi 0/r32/eax + (allocate-array Heap %edx %eax) + 8b/-> *(eax+4) 7/r32/edi # var curr/ecx: (addr kernel-string) = argv 8d/copy-address *(esi+4) 1/r32/ecx # var max/edx: (addr kernel-string) = argv+4+argc -- cgit 1.4.1-2-gfad0