[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 31/41] mach-defpager: Port to x86_64
From: |
Sergey Bugaev |
Subject: |
[PATCH 31/41] mach-defpager: Port to x86_64 |
Date: |
Tue, 9 May 2023 00:31:26 +0300 |
---
mach-defpager/default_pager.c | 28 ++++++++++++++--------------
mach-defpager/file_io.h | 4 ++--
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;
--
2.40.1
- [PATCH 35/41] procfs: Port to x86_64, (continued)
- [PATCH 35/41] procfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 41/41] Style tweaks, Sergey Bugaev, 2023/05/08
- [PATCH 34/41] ext2fs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 33/41] fatfs: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 21/41] sutils: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 27/41] boot: Port to x64_64, Sergey Bugaev, 2023/05/08
- [PATCH 37/41] console-client: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 30/41] startup: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 15/41] utils: Avoid warnings about prototype mismatch, Sergey Bugaev, 2023/05/08
- [PATCH 18/41] proc: Fix use-after-realloc, Sergey Bugaev, 2023/05/08
- [PATCH 31/41] mach-defpager: Port to x86_64,
Sergey Bugaev <=
- [PATCH 38/41] trans: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 19/41] exec: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 25/41] daemons: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 40/41] Disable Linux-based pfinet on x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 23/41] storeio: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 24/41] devnode: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 39/41] Look for mach_i386 in mach/machine/, Sergey Bugaev, 2023/05/08
- [PATCH 36/41] term: Port to x86_64, Sergey Bugaev, 2023/05/08
- [PATCH 28/41] eth-multiplexer: Port to x86_64, Sergey Bugaev, 2023/05/08
- Re: [PATCH 00/41] The x86_64 port, Samuel Thibault, 2023/05/09