diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-05-09 00:31:26 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-05-10 02:43:43 +0200 |
commit | c40df15b14c74762b49c1a8a1e59aaf7e7f35956 (patch) | |
tree | 663325fffe117427e8c15858a10c53b4126a033a /mach-defpager | |
parent | 387a7e84fe2d9c1866df6e27f3afffbfaab26494 (diff) | |
download | hurd-c40df15b14c74762b49c1a8a1e59aaf7e7f35956.tar.gz hurd-c40df15b14c74762b49c1a8a1e59aaf7e7f35956.tar.bz2 hurd-c40df15b14c74762b49c1a8a1e59aaf7e7f35956.zip |
mach-defpager: Port to x86_64
Message-Id: <20230508213136.608575-32-bugaevc@gmail.com>
Diffstat (limited to 'mach-defpager')
-rw-r--r-- | mach-defpager/default_pager.c | 28 | ||||
-rw-r--r-- | mach-defpager/file_io.h | 4 | ||||
-rw-r--r-- | mach-defpager/setup.c | 4 |
3 files changed, 18 insertions, 18 deletions
diff --git a/mach-defpager/default_pager.c b/mach-defpager/default_pager.c index 82e8f526..2aaa3668 100644 --- a/mach-defpager/default_pager.c +++ b/mach-defpager/default_pager.c @@ -204,7 +204,7 @@ new_partition (const char *name, struct file_direct *fdp, { if (check_linux_signature != -3) printf("(default pager): " - "Paging to raw partition %s (%uk paging space)\n", + "Paging to raw partition %s (%zuk paging space)\n", name, part->total_size * (vm_page_size / 1024)); return part; } @@ -222,7 +222,7 @@ new_partition (const char *name, struct file_direct *fdp, /* Filesystem block size is smaller than page size, so we must do several reads to get the whole page. */ vm_address_t baddr; - vm_size_t bsize; + mach_msg_type_number_t bsize; rc = page_read_file_direct(part->file, rsize, LINUX_PAGE_SIZE-rsize, &baddr, @@ -285,27 +285,27 @@ new_partition (const char *name, struct file_direct *fdp, bad -= waste; if (bad > 0) printf("\ -(default pager): Paging to %s, %dk swap-space (%dk bad, %dk wasted at end)\n", +(default pager): Paging to %s, %zuk swap-space (%uk bad, %uk wasted at end)\n", name, part->free * (LINUX_PAGE_SIZE / 1024), bad * (LINUX_PAGE_SIZE / 1024), waste * (LINUX_PAGE_SIZE / 1024)); else printf("\ -(default pager): Paging to %s, %dk swap-space (%dk wasted at end)\n", +(default pager): Paging to %s, %zuk swap-space (%uk wasted at end)\n", name, part->free * (LINUX_PAGE_SIZE / 1024), waste * (LINUX_PAGE_SIZE / 1024)); } else if (bad > 0) printf("\ -(default pager): Paging to %s, %dk swap-space (excludes %dk marked bad)\n", +(default pager): Paging to %s, %zuk swap-space (excludes %uk marked bad)\n", name, part->free * (LINUX_PAGE_SIZE / 1024), bad * (LINUX_PAGE_SIZE / 1024)); else printf("\ -(default pager): Paging to %s, %dk swap-space\n", +(default pager): Paging to %s, %zuk swap-space\n", name, part->free * (LINUX_PAGE_SIZE / 1024)); } @@ -345,7 +345,7 @@ new_partition (const char *name, struct file_direct *fdp, } else printf ("version %u unknown! IGNORING SIGNATURE PAGE!" - " %dk swap-space\n", + " %zuk swap-space\n", hdr->version, part->free * (LINUX_PAGE_SIZE / 1024)); break; @@ -355,7 +355,7 @@ new_partition (const char *name, struct file_direct *fdp, unsigned int waste, i; if (hdr->last_page > part->total_size) { - printf ("signature says %uk, partition has only %uk! ", + printf ("signature says %uk, partition has only %zuk!", hdr->last_page * (LINUX_PAGE_SIZE / 1024), part->total_size * (LINUX_PAGE_SIZE / 1024)); waste = 0; @@ -372,7 +372,7 @@ new_partition (const char *name, struct file_direct *fdp, part->bitmap[bad / NB_BM] |= 1U << (bad % NB_BM); part->free--; } - printf ("%uk swap-space", + printf ("%zuk swap-space", part->free * (LINUX_PAGE_SIZE / 1024)); if (hdr->nr_badpages != 0) printf (" (excludes %uk marked bad)", @@ -388,7 +388,7 @@ new_partition (const char *name, struct file_direct *fdp, { printf ("(default pager): " "Cannot find Linux swap signature page! " - "SKIPPING %s (%uk partition)!", + "SKIPPING %s (%zuk partition)!", name, part->total_size * (vm_page_size / 1024)); free(part->bitmap); free(part->name); @@ -397,7 +397,7 @@ new_partition (const char *name, struct file_direct *fdp, } else printf("(default pager): " - "Paging to raw partition %s (%uk paging space)\n", + "Paging to raw partition %s (%zuk paging space)\n", name, part->total_size * (vm_page_size / 1024)); vm_deallocate(mach_task_self(), raddr, rsize); @@ -1155,7 +1155,7 @@ pager_move_page(union dp_map block) partition_t old_part, new_part; p_index_t old_pindex, new_pindex; union dp_map ret; - vm_size_t size; + mach_msg_type_number_t size; vm_offset_t raddr, offset, new_offset; kern_return_t rc; static char here[] = "%spager_move_page"; @@ -1606,7 +1606,7 @@ default_read(dpager_t ds, { union dp_map block; vm_offset_t raddr; - vm_size_t rsize; + mach_msg_type_number_t rsize; int rc; boolean_t first_time; partition_t part; @@ -1699,7 +1699,7 @@ default_write(dpager_t ds, { union dp_map block; partition_t part; - vm_size_t wsize; + mach_msg_type_number_t wsize; int rc; ddprintf ("default_write: pager offset %lx\n", offset); diff --git a/mach-defpager/file_io.h b/mach-defpager/file_io.h index 2721412b..5f9c4be1 100644 --- a/mach-defpager/file_io.h +++ b/mach-defpager/file_io.h @@ -58,12 +58,12 @@ int page_read_file_direct (struct file_direct *fdp, vm_offset_t offset, vm_size_t size, vm_offset_t *addr, /* out */ - vm_size_t *size_read); /* out */ + mach_msg_type_number_t *size_read); /* out */ int page_write_file_direct(struct file_direct *fdp, vm_offset_t offset, vm_offset_t addr, vm_size_t size, - vm_size_t *size_written); /* out */ + mach_msg_type_number_t *size_written); /* out */ #endif /* file_io.h */ diff --git a/mach-defpager/setup.c b/mach-defpager/setup.c index 087ede71..b09642e3 100644 --- a/mach-defpager/setup.c +++ b/mach-defpager/setup.c @@ -117,7 +117,7 @@ page_read_file_direct (struct file_direct *fdp, vm_offset_t offset, vm_size_t size, vm_offset_t *addr, /* out */ - vm_size_t *size_read) /* out */ + mach_msg_type_number_t *size_read) /* out */ { struct storage_run *r; error_t err; @@ -183,7 +183,7 @@ page_write_file_direct(struct file_direct *fdp, vm_offset_t offset, vm_offset_t addr, vm_size_t size, - vm_size_t *size_written) /* out */ + mach_msg_type_number_t *size_written) /* out */ { struct storage_run *r; error_t err; |