Commit Graph

29 Commits

Author SHA1 Message Date
thorpej e3203cc4b6 Detect if kmem is up, and if not, ignore EX_MALLOCOK. 1999-10-11 22:57:17 +00:00
ross d13c150e3b include <string.h> for memset(3) when compiling userland test setup 1999-06-27 06:18:33 +00:00
thorpej 4476366369 Make sure the regression test compiles. 1999-06-07 02:25:05 +00:00
pk 0e286f5c1f Guard our global resource `expool' against all interrupts. 1999-06-06 22:14:53 +00:00
drochner 4a60ccd128 fix 2 problems with subregion allocation:
-a subregion start was ignored if all previous allocations were before
the subregion, reported by Lennart Augustsson in PR kern/7539
-an existing allocation which overlaps the beginning of the subregion
was ignored (ie overlapped) if is is not the last allocation
1999-05-11 11:02:54 +00:00
mycroft bb815bda9e Fix a thinko in the previous.
Also:
* Do the boundary check when creating a new region as well.
* If we crossed the boundary, don't just throw away the region; lop off the
  beginning and see if we still fit.
SB16 is now fully functional on the Alpha.
1999-02-18 18:52:29 +00:00
mycroft ca00239fe9 Speed up the calculation of dontcross; use EXTENT_ALIGN to calculate it
directly rather than using a loop.  Also adjust so that we can allocate at
the end of the integer range.
1999-02-18 18:13:50 +00:00
thorpej 94962b67c7 Fix some printf format problems on Alpha. 1999-02-12 00:46:11 +00:00
chs 3bd133da7d no need to do locking in extext_destroy(). 1999-01-22 07:57:59 +00:00
christos 34c5a58bb4 Make copyrights consistent; fix weird/trailing spaces add missing (c) etc. 1998-09-12 17:20:02 +00:00
pk 3718fc4aa7 Allow the result of an extent allocation to be congruous to an arbitrary
number modulo the given alignment.
To do this the function extent_alloc_subregion() takes an additional `skew'
parameter.  For compatibility's sake, this function has been renamed to
extent_alloc_subregion1().
1998-09-10 20:52:13 +00:00
pk 6f107350c1 Make user-mode testing work again. 1998-09-01 17:59:36 +00:00
pk 5e3bbeb1e1 Fix a case of duplicate allocation in extent_alloc_subregion() triggered
by specifying a start address that happens to be beyond all currently
regions.
1998-09-01 17:57:44 +00:00
perry 275d1554aa Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) ->  memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
   bcmp(x, y, z) ->  memcmp(x, y, z)
  bzero(x, y)    ->  memset(x, 0, y)
1998-08-04 04:03:10 +00:00
sommerfe 1c2f0a15fd Don't create the extent region pool until one of our callers is of the
opinion that it's safe to call malloc.
1998-07-24 06:40:45 +00:00
pk 4e465abf3f Use a memory pool instead of malloc to allocate region descriptors. 1998-07-23 20:57:17 +00:00
pk 3036bcf8e5 Close a descriptor leak. This proved especially detrimental under heavy
paging.
1998-07-15 12:38:29 +00:00
thorpej 618c279d16 Add fine-grained locking. Still one refinement to make, which will be
done in a separate commit.
1998-06-06 02:25:46 +00:00
thorpej 6428828e64 Const'ify the extent name. 1998-01-21 22:33:49 +00:00
jtc 324ce8d6cb Fix tipo inherited from old version of TNF copyright template. 1997-10-09 07:37:50 +00:00
thorpej fc8c3e00e0 Bring changes from marc-pcmcia branch down to the trunk. 1997-08-29 00:47:18 +00:00
thorpej e98c5a9b1c Fix two boundary/overflow errors in extent_alloc_subregion():
(1): "substart == ex->ex_end" and "subend == ex->ex_start"
     are completely legal parameters for extent_alloc_subregion()
(2): "(subend - substart) + 1" can cause an overflow if the whole
    numeric range is covered by the extent.
Submitted by Matthias Drochner <drochner@zelz26.zel.kfa-juelich.de>
in PR #3119.
1997-05-12 23:36:32 +00:00
cgd e77b6879f7 Feature:
If not compiled with -D_KERNEL, include different includes and
do so macro magic so that this will fit sanely into test harnesses.
When used in user-land, this should be compiled with -D_EXTENT_TESTING.

Bug fixes:
(extent_insert_and_optimize) You can't do things like:
	LIST_REMOVE(elem->...le_next, ...);
	free(elem->...le_next, ...);
They just don't work (and will corrupt your list and/or malloc free list).

(extent_alloc_region_descriptor) Unless you wait, malloc can fail.
Don't accidentally deref a potentially-NULL pointer.
1996-11-21 18:46:34 +00:00
thorpej 52c0d38a1a Several changes:
- Rename EX_NOBLOB to EX_NOCOALESCE; it's much more descriptive of
  what's going on.
- In extent_free_region_descriptor(), if we're a fixed extent,
  freeing a dynamically allocated region descriptor, and someone
  is waiting on the freelist, let the waiter have it, rather than
  free'ing it back to the system.
- Use ALIGN(), rather than our homegrown EXTENT_ALIGN(), when dealing
  with map overhead.  Privatize the EXTENT_ALIGN() macro; there's no need
  to export it.
- Implement EX_BOUNDZERO flag.  This changes the boundary line policy in
  extent_alloc() and extent_alloc_subregion(); boundary lines are
  computed relative to 0, rather then the start of the extent.
- Fix a nasty race between multiple participants doing region and
  descriptor allocation.
- Add a new flag to specify that it's ok to wait for space in the
  extent: EX_WAITSPACE.
- Blow away an unnecessary splhigh()/splx().
- Put a bunch of sanity code inside #ifdef DIAGNOSTIC/#endif.
1996-10-17 08:27:35 +00:00
christos f443b89c92 backout previous kprintf change 1996-10-13 02:32:29 +00:00
christos 60d201973e printf -> kprintf, sprintf -> ksprintf 1996-10-10 22:46:11 +00:00
thorpej 3946240709 Fix unititialized variable warning. Pointed out by Aaron Brown. 1996-07-25 20:41:48 +00:00
thorpej aba7675464 In extent_alloc_subregion(), don't adjust the initial boundary check
value if we're not concerned with boundary checking.  Avoids a stupid
infinite loop.
1996-07-23 23:09:10 +00:00
thorpej 6041e29f1f My extent map manager. Sort of like resource maps, but more flexible.
Understands allocation aligment and boundary restrictions, "specific region"
allocations, and suballocations.  Capable of statically or dynamically
allocating map overhead.

Many thanks to Matthias Drochner for running the code for me, and sending
me bug fixes, optimizations, and suggestions.  Also, many thanks to
Chris Demetriou for his extremely helpful suggestions.

XXX No manual page yet.  One is forthcoming, as soon as I can scare up
the time to write one.  This has been sitting on my plate for quite a
while, and several projects are waiting for it.  Time to move on.
1996-06-23 00:10:08 +00:00