Commit | Line | Data |
---|---|---|
15637ed4 RG |
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 MERCHANTIBILITY 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 | |
78ed81a3 | 17 | * |
18 | * from: unknown? | |
19 | * $Id$ | |
15637ed4 RG |
20 | */ |
21 | ||
78ed81a3 | 22 | #ifndef _SYS_RLIST_H_ |
23 | #define _SYS_RLIST_H_ | |
24 | ||
15637ed4 RG |
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 | /* Functions to manipulate resource lists. */ | |
33 | extern rlist_free __P((struct rlist **, unsigned, unsigned)); | |
34 | int rlist_alloc __P((struct rlist **, unsigned, unsigned *)); | |
35 | extern rlist_destroy __P((struct rlist **)); | |
36 | ||
37 | ||
38 | /* heads of lists */ | |
39 | struct rlist *swapmap; | |
78ed81a3 | 40 | |
41 | #endif /* _SYS_RLIST_H_ */ |