summaryrefslogtreecommitdiff
path: root/sys/libkern
Commit message (Collapse)AuthorAgeFilesLines
* Fix warnings in preparation for adding -Wall -Wcast-qual to theMatthew Dillon1999-01-282-4/+4
| | | | | | | kernel compile Notes: svn path=/head/; revision=43315
* - Fix modulo bug.Nate Williams1998-12-011-2/+2
| | | | | | | Reminded by: bde Notes: svn path=/head/; revision=41434
* Converted rcsid to $Id$ again. There shouldn't be any rcsids in the kernel.Bruce Evans1998-08-171-8/+2
| | | | Notes: svn path=/head/; revision=38409
* Changed to the C9x draft spelling of the (unsigned) integral typeBruce Evans1998-07-141-12/+12
| | | | | | | | | | | suitable for holding object pointers (ptrint_t -> uintptr_t). Added corresponding signed type (intptr_t). Changed/added corresponding non-C9x types for function pointers to match. Don't use nonstandard types to implement these types, and don't comment on them in <machine/types.h>. Notes: svn path=/head/; revision=37629
* #include sys/libkern.h instead of stdlib.h.Poul-Henning Kamp1998-06-301-2/+2
| | | | | | | | | PR: 7105 Reviewed by: phk Submitted by: Robert Watson <robert+freebsd@cyrus.watson.org> Notes: svn path=/head/; revision=37289
* Add initial support for the FreeBSD/alpha kernel. This is very much aDoug Rabson1998-06-106-0/+228
| | | | | | | | | | | | | work in progress and has never booted a real machine. Initial development and testing was done using SimOS (see http://simos.stanford.edu for details). On the SimOS simulator, this port successfully reaches single-user mode and has been tested with loads as high as one copy of /bin/ls :-). Obtained from: partly from NetBSD/alpha Notes: svn path=/head/; revision=36849
* Support compiling with `gcc -ansi'.Bruce Evans1998-04-151-5/+5
| | | | Notes: svn path=/head/; revision=35210
* Make our v_usecount vnode reference count work identically to theJohn Dyson1998-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | original BSD code. The association between the vnode and the vm_object no longer includes reference counts. The major difference is that vm_object's are no longer freed gratuitiously from the vnode, and so once an object is created for the vnode, it will last as long as the vnode does. When a vnode object reference count is incremented, then the underlying vnode reference count is incremented also. The two "objects" are now more intimately related, and so the interactions are now much less complex. When vnodes are now normally placed onto the free queue with an object still attached. The rundown of the object happens at vnode rundown time, and happens with exactly the same filesystem semantics of the original VFS code. There is absolutely no need for vnode_pager_uncache and other travesties like that anymore. A side-effect of these changes is that SMP locking should be much simpler, the I/O copyin/copyout optimizations work, NFS should be more ponderable, and further work on layered filesystems should be less frustrating, because of the totally coherent management of the vnode objects and vnodes. Please be careful with your system while running this code, but I would greatly appreciate feedback as soon a reasonably possible. Notes: svn path=/head/; revision=32286
* Rename some local variables to avoid shadowing other local variables.Poul-Henning Kamp1997-11-071-4/+4
| | | | | | | Found by: -Wshadow Notes: svn path=/head/; revision=31017
* Removed unused #includes.Bruce Evans1997-08-025-10/+5
| | | | Notes: svn path=/head/; revision=27845
* Style optimization in newly added POSIX range []] conformance, redoAndrey A. Chernov1997-06-071-6/+6
| | | | | | | 'for' loop as do...while and remove variable unneded now Notes: svn path=/head/; revision=26492
* Add missing FNM_PERIOD check for '[' rangeAndrey A. Chernov1997-06-061-4/+10
| | | | | | | | Don't treat !^ as first characters in the range, just as negate sign [/] never match if FNM_PATHNAME Notes: svn path=/head/; revision=26486
* 1) Now conforms POSIX.2 2.8.3.2 requirements about []] patternAndrey A. Chernov1997-06-061-11/+35
| | | | | | | 2) Treat unclosed [ range in pattern as regular characters (bash style) Notes: svn path=/head/; revision=26484
* Fix a bug that caused some false mismatches when both FNM_PATHNAMEJohn Polstra1997-04-291-1/+2
| | | | | | | | | and FNM_LEADING_DIR were specified and the pattern ended with "*". Example: pattern="src/usr.sbin/w*", string="src/usr.sbin/watch/watch.8,v". This should match, but did not. Notes: svn path=/head/; revision=25269
* Eliminate some function calls when locale not usedAndrey A. Chernov1997-04-041-6/+4
| | | | Notes: svn path=/head/; revision=24632
* Speedup in case locale not usedAndrey A. Chernov1997-04-041-2/+6
| | | | Notes: svn path=/head/; revision=24630
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-2236-36/+36
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-1436-36/+36
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* collate_range_cmp -> __collate_range_cmpAndrey A. Chernov1996-10-311-3/+4
| | | | Notes: svn path=/head/; revision=19276
* Unremoved used #include of <sys/systm.h> for the !GUPROF case.Bruce Evans1996-10-251-1/+4
| | | | Notes: svn path=/head/; revision=19169
* GNU-style changes:Andrey A. Chernov1996-10-231-10/+14
| | | | | | | | | | 1) Rename FNM_ICASE to FNM_CASEFOLD 2) Add FNM_LEADING_DIR Add proper (unsigned char) casts to tolower(). Use 'char' function argument for proper sign extension Notes: svn path=/head/; revision=19132
* add flag FNM_ICASE for case insensitve searchWolfram Schneider1996-10-201-1/+20
| | | | | | | Reviewed by: ache Notes: svn path=/head/; revision=19059
* Improved non-statistical (GUPROF) profiling:Bruce Evans1996-10-171-72/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - use a more accurate and more efficient method of compensating for overheads. The old method counted too much time against leaf functions. - normally use the Pentium timestamp counter if available. On Pentiums, the times are now accurate to within a couple of cpu clock cycles per function call in the (unlikely) event that there are no cache misses in or caused by the profiling code. - optionally use an arbitrary Pentium event counter if available. - optionally regress to using the i8254 counter. - scaled the i8254 counter by a factor of 128. Now the i8254 counters overflow slightly faster than the TSC counters for a 150MHz Pentium :-) (after about 16 seconds). This is to avoid fractional overheads. files.i386: permon.c temporarily has to be classified as a profiling-routine because a couple of functions in it may be called from profiling code. options.i386: - I586_CTR_GUPROF is currently unused (oops). - I586_PMC_GUPROF should be something like 0x70000 to enable (but not use unless prof_machdep.c is changed) support for Pentium event counters. 7 is a control mode and the counter number 0 is somewhere in the 0000 bits (see perfmon.h for the encoding). profile.h: - added declarations. - cleaned up separation of user mode declarations. prof_machdep.c: Mostly clock-select changes. The default clock can be changed by editing kmem. There should be a sysctl for this. subr_prof.c: - added copyright. - calibrate overheads for the new method. - documented new method. - fixed races and and machine dependencies in start/stop code. mcount.c: Use the new overhead compensation method. gmon.h: - changed GPROF4 counter type from unsigned to int. Oops, this should be machine-dependent and/or int32_t. - reorganized overhead counters. Submitted by: Pentium event counter changes mostly by wollman Notes: svn path=/head/; revision=19000
* add simple srandom() and prototypePeter Wemm1996-09-231-2/+10
| | | | Notes: svn path=/head/; revision=18474
* Updated #includes to 4.4Lite style.Bruce Evans1996-09-105-10/+10
| | | | Notes: svn path=/head/; revision=18207
* Fixed the easy cases of const poisoning in the kernel. Cosmetic.Bruce Evans1996-08-313-8/+9
| | | | Notes: svn path=/head/; revision=17974
* Don't depend in the kernel on the gcc feature of doing arithmetic onBruce Evans1996-08-311-10/+10
| | | | | | | pointers of type `void *'. Warn about this in future. Notes: svn path=/head/; revision=17971
* Removed sccsids and rcsids and added Id$ to save space like everythingBruce Evans1996-08-283-17/+5
| | | | | | | else in libkern. Notes: svn path=/head/; revision=17880
* Cleaned up interrupt masking by declaring the state variable in aBruce Evans1996-08-281-6/+5
| | | | | | | | | | machine-dependent macro and passing it to all machine-dependent macros. Eliminated the state variable for the GUPROF case. Notes: svn path=/head/; revision=17879
* Convert to newly aded collate compare functionAndrey A. Chernov1996-08-121-3/+3
| | | | Notes: svn path=/head/; revision=17552
* Use collate for alpha character rangesAndrey A. Chernov1996-08-121-1/+4
| | | | Notes: svn path=/head/; revision=17533
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-1/+1
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Added index() which will be used shortly in some fixes to the ibcs2Nate Williams1996-06-071-0/+53
| | | | | | | emulation code. Notes: svn path=/head/; revision=16175
* removed:Poul-Henning Kamp1996-05-021-2/+2
| | | | | | | | | | | | CLBYTES PD_SHIFT PGSHIFT NBPG PGOFSET CLSIZELOG2 CLSIZE pdei() ptei() kvtopte() ptetov() ispt() ptetoav() &c &c new: NPDEPG Major macro cleanup. Notes: svn path=/head/; revision=15543
* Don't include <sys/types.h> when it isn't used.Bruce Evans1996-04-191-2/+1
| | | | | | | | This commit covers most of the ANSI library functions. Many others only need <sys/types.h> because they use u_xxx. Notes: svn path=/head/; revision=15312
* Don't depend on <sys/types.h> including <sys/cdefs.h>.Bruce Evans1996-04-191-1/+2
| | | | Notes: svn path=/head/; revision=15311
* Extend to handle all radix < 37Poul-Henning Kamp1996-01-241-1/+2
| | | | Notes: svn path=/head/; revision=13617
* Moved BCD declarations to the correct header (libkern.h).Bruce Evans1996-01-161-25/+25
| | | | | | | | | | | Fixed BCD declarations. They didn't match their definitions... libkern.h, bcd.c: KNFised. `indent' worked 99% perfectly on bcd.c. It worked 99% _imperfectly_ on subr_prf.c. Notes: svn path=/head/; revision=13459
* My wife is busy making me a new conical hat, so you don't need toPoul-Henning Kamp1996-01-151-2/+2
| | | | | | | | send any to me this time. Commited an old copy of this files where the tables were swapped. Duh!. Notes: svn path=/head/; revision=13445
* Add the bcd <-> bin and hex -> ascii tables.Poul-Henning Kamp1996-01-151-0/+34
| | | | Notes: svn path=/head/; revision=13436
* recording cvs-1.6 file deathPeter Wemm1995-12-302-193/+0
| | | | Notes: svn path=/cvs2svn/branches/ATT/; revision=13122
* Copied mcount.c from the library again. #include'ing it via a relativeBruce Evans1995-12-301-3/+325
| | | | | | | path to a possibly-nonexistent place didn't work well enough. Sigh. Notes: svn path=/head/; revision=13116
* Implemented non-statistical kernel profiling. This is based onBruce Evans1995-12-291-179/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | looking at a high resolution clock for each of the following events: function call, function return, interrupt entry, interrupt exit, and interesting branches. The differences between the times of these events are added at appropriate places in a ordinary histogram (as if very fast statistical profiling sampled the pc at those places) so that ordinary gprof can be used to analyze the times. gmon.h: Histogram counters need to be 4 bytes for microsecond resolutions. They will need to be larger for the 586 clock. The comments were vax-centric and wrong even on vaxes. Does anyone disagree? gprof4.c: The standard gprof should support counters of all integral sizes and the size of the counter should be in the gmon header. This hack will do until then. (Use gprof4 -u to examine the results of non-statistical profiling.) config/*: Non-statistical profiling is configured with `config -pp'. `config -p' still gives ordinary profiling. kgmon/*: Non-statistical profiling is enabled with `kgmon -B'. `kgmon -b' still enables ordinary profiling (and distables non-statistical profiling) if non-statistical profiling is configured. Notes: svn path=/head/; revision=13107
* Removed almost all traces of libkern.a. The objects that were inBruce Evans1995-12-261-37/+0
| | | | | | | | | | libkern.a are now specified by listing their source files in files.${MACHINE}. The list is machine-dependent to save space. All the necessary object for each machine must be linked into the kernel in case an lkm wants one. Notes: svn path=/head/; revision=13031
* Added prototypes.Bruce Evans1995-12-262-5/+15
| | | | Notes: svn path=/head/; revision=13030
* Add-back strlen.c to the library in case a kernel is compiled withoutNate Williams1995-12-191-6/+5
| | | | | | | | optimization. Gcc only in-lines calls to strlen with optimization turned on. Notes: svn path=/head/; revision=12932
* Add qsort() to libkern, taken from libc.Poul-Henning Kamp1995-11-082-1/+175
| | | | Notes: svn path=/head/; revision=12151
* Comment out, but don't delete stuff we don't use.Poul-Henning Kamp1995-10-051-6/+18
| | | | | | | Classify in "gcc stuff" and "legitimate stuff". Notes: svn path=/head/; revision=11223
* Rearrange the inner loop of scanc() to get better code on i*86'sBruce Evans1995-07-111-2/+10
| | | | | | | | | | | | | | (on an i486, 10 cycles (+ cache misses) instead of 15). The change should be a no-op if the compiler is any good. The best possible i*86 code for the same algorithm is only 1 more cycle faster on i486's so I don't want to bother implementing an assembler version. scanc() is a bottleneck for OPOST processing. It is naturally about 4 times as slow as bcopy() on 32-bit systems. Notes: svn path=/head/; revision=9485
* Remove trailing whitespace.Rodney W. Grimes1995-05-304-8/+8
| | | | Notes: svn path=/head/; revision=8876