FreeBSD/Linux Kernel Cross Reference
sys/sys/rlist.h
1 /*
2 * Copyright (c) 1992 William Jolitz. All rights reserved.
3 * Written by William Jolitz 1/92
4 *
5 * Redistribution and use in source and binary forms are freely permitted
6 * provided that the above copyright notice and attribution and date of work
7 * and this paragraph are duplicated in all such forms.
8 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
9 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
10 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Resource lists.
13 *
14 * Usage:
15 * rlist_free(&swapmap, 100, 200); add space to swapmap
16 * rlist_alloc(&swapmap, 100, &loc); obtain 100 sectors from swap
17 *
18 * from: unknown?
19 * $FreeBSD: src/sys/sys/rlist.h,v 1.9.4.1 1999/09/05 08:22:49 peter Exp $
20 */
21
22 #ifndef _SYS_RLIST_H_
23 #define _SYS_RLIST_H_
24
25 /* A resource list element. */
26 struct rlist {
27 unsigned rl_start; /* boundaries of extent - inclusive */
28 unsigned rl_end; /* boundaries of extent - inclusive */
29 struct rlist *rl_next; /* next list entry, if present */
30 };
31
32 struct rlisthdr {
33 int rlh_lock; /* list lock */
34 struct rlist *rlh_list; /* list itself */
35 };
36
37 #define RLH_DESIRED 0x2
38 #define RLH_LOCKED 0x1
39
40 /* extern struct rlisthdr swaplist; */
41
42 /* Functions to manipulate resource lists. */
43 extern void rlist_free __P((struct rlisthdr *, unsigned, unsigned));
44 int rlist_alloc __P((struct rlisthdr *, unsigned, unsigned *));
45 extern void rlist_destroy __P((struct rlisthdr *));
46
47 #endif /* _SYS_RLIST_H_ */
Cache object: 1b5013476d2a906afc993c06a943cc47
|