From 5ad3d2212f7f879b747dda6f166adaa87bc54245 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 10 Nov 1998 09:08:49 +0000 Subject: [PATCH] kzipboot uses kern/inflate.c outside the kernel by providing its own minimal malloc/free implementation. Stop passing M_GZIP to it. --- sys/i386/boot/kzipboot/malloc.c | 6 ++---- sys/kern/inflate.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/sys/i386/boot/kzipboot/malloc.c b/sys/i386/boot/kzipboot/malloc.c index cf51be721a51..86bccc8469c9 100644 --- a/sys/i386/boot/kzipboot/malloc.c +++ b/sys/i386/boot/kzipboot/malloc.c @@ -36,9 +36,8 @@ extern unsigned char *storage; void * -malloc(nbytes, junk1, junk2) /* junk? not used */ +malloc(nbytes) size_t nbytes; - int junk1, junk2; { unsigned char *p = storage; storage += nbytes; @@ -51,8 +50,7 @@ malloc(nbytes, junk1, junk2) /* junk? not used */ } void -free(cp, junk) /* junk not used */ +free(cp) void *cp; - int junk; { } diff --git a/sys/kern/inflate.c b/sys/kern/inflate.c index 4558eb3519bd..1db9b2c99642 100644 --- a/sys/kern/inflate.c +++ b/sys/kern/inflate.c @@ -7,7 +7,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: inflate.c,v 1.10 1997/10/11 18:31:20 phk Exp $ + * $Id: inflate.c,v 1.11 1997/10/12 20:23:40 phk Exp $ * * */ @@ -16,10 +16,13 @@ #include #ifdef KERNEL #include +#include #endif #include +#ifdef KERNEL static MALLOC_DEFINE(M_GZIP, "Gzip trees", "Gzip trees"); +#endif /* needed to make inflate() work */ #define uch u_char @@ -47,8 +50,10 @@ extern void putstr (char *); static const int qflag = 0; #ifndef KERNEL /* want to use this file in kzip also */ -extern unsigned char *malloc (int, int, int); -extern void free (void*, int); +extern unsigned char *kzipmalloc (int); +extern void kzipfree (void*); +#define malloc(x, y, z) kzipmalloc((x)) +#define free(x, y) kzipfree((x)) #endif /*