2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# Makefile for some libs needed in the kernel.
|
|
|
|
#
|
|
|
|
|
|
|
|
lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
|
|
|
|
bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
|
[PATCH] Add initial implementation of klist helpers.
This klist interface provides a couple of structures that wrap around
struct list_head to provide explicit list "head" (struct klist) and
list "node" (struct klist_node) objects. For struct klist, a spinlock
is included that protects access to the actual list itself. struct
klist_node provides a pointer to the klist that owns it and a kref
reference count that indicates the number of current users of that node
in the list.
The entire point is to provide an interface for iterating over a list
that is safe and allows for modification of the list during the
iteration (e.g. insertion and removal), including modification of the
current node on the list.
It works using a 3rd object type - struct klist_iter - that is declared
and initialized before an iteration. klist_next() is used to acquire the
next element in the list. It returns NULL if there are no more items.
This klist interface provides a couple of structures that wrap around
struct list_head to provide explicit list "head" (struct klist) and
list "node" (struct klist_node) objects. For struct klist, a spinlock
is included that protects access to the actual list itself. struct
klist_node provides a pointer to the klist that owns it and a kref
reference count that indicates the number of current users of that node
in the list.
The entire point is to provide an interface for iterating over a list
that is safe and allows for modification of the list during the
iteration (e.g. insertion and removal), including modification of the
current node on the list.
It works using a 3rd object type - struct klist_iter - that is declared
and initialized before an iteration. klist_next() is used to acquire the
next element in the list. It returns NULL if there are no more items.
Internally, that routine takes the klist's lock, decrements the reference
count of the previous klist_node and increments the count of the next
klist_node. It then drops the lock and returns.
There are primitives for adding and removing nodes to/from a klist.
When deleting, klist_del() will simply decrement the reference count.
Only when the count goes to 0 is the node removed from the list.
klist_remove() will try to delete the node from the list and block
until it is actually removed. This is useful for objects (like devices)
that have been removed from the system and must be freed (but must wait
until all accessors have finished).
Internally, that routine takes the klist's lock, decrements the reference
count of the previous klist_node and increments the count of the next
klist_node. It then drops the lock and returns.
There are primitives for adding and removing nodes to/from a klist.
When deleting, klist_del() will simply decrement the reference count.
Only when the count goes to 0 is the node removed from the list.
klist_remove() will try to delete the node from the list and block
until it is actually removed. This is useful for objects (like devices)
that have been removed from the system and must be freed (but must wait
until all accessors have finished).
Signed-off-by: Patrick Mochel <mochel@digitalimplant.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
diff -Nru a/include/linux/klist.h b/include/linux/klist.h
2005-03-22 03:45:16 +08:00
|
|
|
idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \
|
|
|
|
sha1.o halfmd4.o
|
|
|
|
|
|
|
|
lib-y += kobject.o kref.o kobject_uevent.o klist.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
obj-y += sort.o parser.o
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_DEBUG_KOBJECT),y)
|
|
|
|
CFLAGS_kobject.o += -DDEBUG
|
|
|
|
CFLAGS_kobject_uevent.o += -DDEBUG
|
|
|
|
endif
|
|
|
|
|
|
|
|
lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
|
|
|
|
lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
|
|
|
|
lib-$(CONFIG_GENERIC_FIND_NEXT_BIT) += find_next_bit.o
|
|
|
|
obj-$(CONFIG_LOCK_KERNEL) += kernel_lock.o
|
2005-06-22 08:14:34 +08:00
|
|
|
obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
|
|
|
|
lib-y += dec_and_lock.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o
|
|
|
|
obj-$(CONFIG_CRC32) += crc32.o
|
|
|
|
obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
|
|
|
|
obj-$(CONFIG_GENERIC_IOMAP) += iomap.o
|
2005-06-22 08:15:02 +08:00
|
|
|
obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
|
|
|
|
obj-$(CONFIG_ZLIB_DEFLATE) += zlib_deflate/
|
|
|
|
obj-$(CONFIG_REED_SOLOMON) += reed_solomon/
|
|
|
|
|
2005-06-24 11:49:30 +08:00
|
|
|
lib-$(CONFIG_TEXTSEARCH) += textsearch.o
|
[LIB]: Knuth-Morris-Pratt textsearch algorithm
Implements a linear-time string-matching algorithm due to Knuth,
Morris, and Pratt [1]. Their algorithm avoids the explicit
computation of the transition function DELTA altogether. Its
matching time is O(n), for n being length(text), using just an
auxiliary function PI[1..m], for m being length(pattern),
precomputed from the pattern in time O(m). The array PI allows
the transition function DELTA to be computed efficiently
"on the fly" as needed. Roughly speaking, for any state
"q" = 0,1,...,m and any character "a" in SIGMA, the value
PI["q"] contains the information that is independent of "a" and
is needed to compute DELTA("q", "a") [2]. Since the array PI
has only m entries, whereas DELTA has O(m|SIGMA|) entries, we
save a factor of |SIGMA| in the preprocessing time by computing
PI rather than DELTA.
[1] Cormen, Leiserson, Rivest, Stein
Introdcution to Algorithms, 2nd Edition, MIT Press
[2] See finite automation theory
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
2005-06-24 11:58:37 +08:00
|
|
|
obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
|
2005-06-24 11:49:30 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
hostprogs-y := gen_crc32table
|
|
|
|
clean-files := crc32table.h
|
|
|
|
|
|
|
|
$(obj)/crc32.o: $(obj)/crc32table.h
|
|
|
|
|
|
|
|
quiet_cmd_crc32 = GEN $@
|
|
|
|
cmd_crc32 = $< > $@
|
|
|
|
|
|
|
|
$(obj)/crc32table.h: $(obj)/gen_crc32table
|
|
|
|
$(call cmd,crc32)
|