2 * Copyright (c) 1997, 1998 John S. Dyson
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. Absolutely no warranty of function or purpose is made by the author
14 * $FreeBSD: src/sys/vm/vm_zone.h,v 1.13.2.2 2002/10/10 19:50:16 dillon Exp $
15 * $DragonFly: src/sys/vm/vm_zone.h,v 1.2 2003/06/17 04:29:00 dillon Exp $
22 #define ZONE_INTERRUPT 0x0001 /* If you need to allocate at int time */
23 #define ZONE_PANICFAIL 0x0002 /* panic if the zalloc fails */
24 #define ZONE_BOOT 0x0010 /* Internal flag used by zbootinit */
26 #include <machine/lock.h>
28 typedef struct vm_zone {
29 struct simplelock zlock; /* lock for data structure */
30 void *zitems; /* linked list of items */
31 int zfreecnt; /* free entries */
32 int zfreemin; /* minimum number of free entries */
33 int znalloc; /* number of allocations */
34 vm_offset_t zkva; /* Base kva of zone */
35 int zpagecount; /* Total # of allocated pages */
36 int zpagemax; /* Max address space */
37 int zmax; /* Max number of entries allocated */
38 int ztotal; /* Total entries allocated now */
39 int zsize; /* size of each entry */
40 int zalloc; /* hint for # of pages to alloc */
41 int zflags; /* flags for zone */
42 int zallocflag; /* flag for allocation */
43 struct vm_object *zobj; /* object to hold zone */
44 char *zname; /* name for diags */
45 struct vm_zone *znext; /* list of zones for sysctl */
49 void zerror __P((int)) __dead2;
50 vm_zone_t zinit __P((char *name, int size, int nentries, int flags,
52 int zinitna __P((vm_zone_t z, struct vm_object *obj, char *name,
53 int size, int nentries, int flags, int zalloc));
54 void * zalloc __P((vm_zone_t z));
55 void zfree __P((vm_zone_t z, void *item));
56 void * zalloci __P((vm_zone_t z));
57 void zfreei __P((vm_zone_t z, void *item));
58 void zbootinit __P((vm_zone_t z, char *name, int size, void *item,
60 void * _zget __P((vm_zone_t z));
62 #endif /* _SYS_ZONE_H */