1 |
/* Slab allocator. |
/* Slab allocator. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@rtmk.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
23 |
/* ??? remaining to do is to clean up this file - write comments. */ |
/* ??? remaining to do is to clean up this file - write comments. */ |
24 |
|
|
25 |
#include "queue.h" |
#include "queue.h" |
26 |
|
#include "thread-lock.h" |
27 |
|
|
28 |
struct kmem_bufctl |
struct kmem_bufctl |
29 |
{ |
{ |
65 |
struct kmem_hash_entry **hash;/* <bufctl, address> hash table. */ |
struct kmem_hash_entry **hash;/* <bufctl, address> hash table. */ |
66 |
int hash_size; /* Size of hash table. */ |
int hash_size; /* Size of hash table. */ |
67 |
int hash_ratio; /* load ratio. */ |
int hash_ratio; /* load ratio. */ |
68 |
|
struct thread_lock lock; /* Lock for cache. */ |
69 |
|
|
70 |
#define KMEM_CACHE_MAGIC 0x643c435f /* ??? random odd value. */ |
#define KMEM_CACHE_MAGIC 0x643c435f /* ??? random odd value. */ |
71 |
unsigned int magic; /* Magic value. */ |
unsigned int magic; /* Magic value. */ |
|
spin_lock_t lock; /* Spin lock. */ |
|
72 |
}; |
}; |
73 |
|
|
74 |
/* Public flags: */ |
/* Public flags: */ |