@@ -18,11 +18,8 @@ /* we define all our platform functions here, whether or not * they're for the correct platform - only the ones that are * called by the preprocessed form of the code will actually * be linked, linker errors are our friend here! */ -extern void* kmem_platform_mmap(void* addr, - unsigned long sz, unsigned long prot, unsigned long flags, - unsigned long fd, unsigned long off); kmcond kmheapa(void** where, sz len) { /* allocate an object on the heap and return * a pointer, or NULL if the allocation failed. */ @@ -60,8 +57,12 @@ posix_prot_read | posix_prot_write, posix_flag_anonymous | posix_map_shared, -1, 0 }; + + /* impl note: while per manpage fd is "ignored" + * for MAP_ANONYMOUS, "some implementations" require + * a value of -1 */ struct k_platform_syscall_answer r = k_platform_syscall (k_platform_syscall_mmap, Kmsz(args), args); @@ -73,17 +74,8 @@ case k_platform_error_ENOMEM: return kmcond_no_room; default: return kmcond_fail_assert; } } - - /* region.byte = kmem_platform_mmap(null, region_size, */ - /* posix_prot_read | posix_prot_write, */ - /* posix_flag_anonymous | posix_map_shared, -1, 0); */ - - /* impl note: while per manpage fd is "ignored" - * for MAP_ANONYMOUS, "some implementations" require - * a value of -1 */ - # else Knoimpl(kmheapa,KVos); # error missing implementation # endif