summaryrefslogtreecommitdiff
path: root/mach-defpager/setup.c
diff options
context:
space:
mode:
authorMaksym Planeta <mcsim.planeta@gmail.com>2012-01-08 14:51:42 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-26 23:43:51 +0200
commitd4b231dd9f874076c62f35590a9f6b93ca6481d7 (patch)
tree5a05a26e583aba1a191b72118be47571b9cbefbc /mach-defpager/setup.c
parentf605070d37c741436b5f82745eae2a5c018e304d (diff)
Remove warnings during compilation.
* mach-defpager/kalloc.c: Added missing prototypes, headers, types. * mach-defpager/wiring.c: Likewise. * mach-defpager/default_pager.c: Likewise. * mach-defpager/main.c: Likewise. * mach-defpager/setup.c: Likewise. (S_default_pager_paging_storage): Fix wrong calling of kfree. * mach-defpager/kalloc.h: New file with prototypes from kalloc.c. * mach-defpager/default_pager.h: New file with prototypes from default_pager.c. * mach-defpager/Makefile (LCLHDRS): Add new header files.
Diffstat (limited to 'mach-defpager/setup.c')
-rw-r--r--mach-defpager/setup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mach-defpager/setup.c b/mach-defpager/setup.c
index 05c19f33..080b0fa6 100644
--- a/mach-defpager/setup.c
+++ b/mach-defpager/setup.c
@@ -22,6 +22,11 @@
#include <stddef.h>
#include <assert.h>
#include <mach.h>
+#include <string.h>
+#include <strings.h>
+
+#include <default_pager.h>
+#include <kalloc.h>
#include "file_io.h"
#include "default_pager_S.h"
@@ -32,9 +37,6 @@ int page_aligned (vm_offset_t num)
return trunc_page (num) == num;
}
-/* From serverboot/kalloc.c. */
-extern void *kalloc (vm_size_t);
-
extern mach_port_t default_pager_default_port; /* default_pager.c */
kern_return_t
@@ -87,7 +89,7 @@ S_default_pager_paging_storage (mach_port_t pager,
fdp->runs[i].length = runs[i + 1];
if (fdp->runs[i].start + fdp->runs[i].length > devsize)
{
- kfree (fdp);
+ kfree (fdp, offsetof (struct file_direct, runs[nrun]));
return EINVAL;
}
fdp->fd_size += fdp->runs[i].length;
@@ -295,7 +297,7 @@ remove_paging_file (char *file_name)
struct file_direct *fdp = 0;
kern_return_t kr;
- kr = destroy_paging_partition(file_name, &fdp);
+ kr = destroy_paging_partition(file_name, (void **)&fdp);
if (kr == KERN_SUCCESS && fdp != 0)
{
mach_port_deallocate (mach_task_self (), fdp->device);