summaryrefslogtreecommitdiff
path: root/sys/kern/subr_prf.c
Commit message (Collapse)AuthorAgeFilesLines
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-2/+2
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Add vsnrprintf() which is just like vsnprintf() but takes a "radix"Poul-Henning Kamp2003-02-041-0/+17
| | | | | | | argument for the kernel-special %r format. Notes: svn path=/head/; revision=110316
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-2/+2
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* Cast the integer read as the first argument for %b to an unsigned integerJohn Baldwin2003-01-071-1/+1
| | | | | | | | | | | | so it's value is not sign extended when assigned to the uintmax_t variable used internally by printf. For example, if bit 31 is set in the cpuid feature word, then %b would print out the initial value as a 16 character hexadecimal value. Now it only prints out an 8 character value. Reviewed by: bde Notes: svn path=/head/; revision=108890
* Move #include of ddb/ddb.h up with the rest.Poul-Henning Kamp2003-01-041-2/+6
| | | | Notes: svn path=/head/; revision=108678
* Make the msg_size, msg_bufx and msg_bufr memebers of struct msgbufThomas Moestl2002-11-141-2/+3
| | | | | | | | | | | | | | signed, since they describe a ring buffer and signed arithmetic is performed on them. This avoids some evilish casts. Since this changes all but two members of this structure, style(9) those remaining ones, too. Requested by: bde Reviewed by: bde (earlier version) Notes: svn path=/head/; revision=106917
* Add support for the C99 %t format modifier.Maxime Henrion2002-11-131-2/+11
| | | | Notes: svn path=/head/; revision=106855
* - Rename the DDB specific %z printf format to %y.Maxime Henrion2002-10-251-3/+12
| | | | | | | | | | | | | - Make DDB use %y instead of %z. - Teach GCC about %y. - Implement support for the C99 %z format modifier. Approved by: re@ Reviewed by: peter Tested on: i386, sparc64 Notes: svn path=/head/; revision=105954
* Fix %z to always print values as signed like it is supposed to.John Baldwin2002-10-111-2/+2
| | | | | | | | Reviewed by: bde Tested on: i386 in ddb Notes: svn path=/head/; revision=104924
* Change a return to a break so the local buffers get properly freeed.Poul-Henning Kamp2002-09-281-1/+1
| | | | | | | | | Spotte by: FlexeLint Reviewed by: rwatson Notes: svn path=/head/; revision=104114
* Make kern.log_console_output a tuneable aswell as a sysctl.David Malone2002-08-111-0/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=101693
* dd %i as an alias for %d for greater compatibility with our *BSD bretherenWarner Losh2002-07-051-0/+1
| | | | | | | | Obtained from: NetBSD Reviewed by: jake, rwatson, bosko Notes: svn path=/head/; revision=99459
* More caddr_t removal.Alfred Perlstein2002-06-291-1/+1
| | | | | | | Change struct knote's kn_hook from caddr_t to void *. Notes: svn path=/head/; revision=98998
* ANSIfy the one remaining K&R function.Dag-Erling Smørgrav2002-06-021-4/+1
| | | | Notes: svn path=/head/; revision=97751
* Whitespace nits.Dag-Erling Smørgrav2002-06-021-2/+2
| | | | Notes: svn path=/head/; revision=97750
* Add support for 'j' flag. Simplify the size modifier code and reduce codeDag-Erling Smørgrav2002-06-021-100/+71
| | | | | | | | | duplication. Also add support for 'n' specifier. Reviewed by: bde Notes: svn path=/head/; revision=97749
* Add a sysctl which disables the logging of console output.David Malone2002-04-291-0/+7
| | | | | | | | Approved by: phk MFC after: 2 weeks Notes: svn path=/head/; revision=95713
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-011-1/+1
| | | | | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@ Notes: svn path=/head/; revision=93593
* Remove __P.Alfred Perlstein2002-03-191-4/+4
| | | | Notes: svn path=/head/; revision=92723
* Stop abusing the pgrpsess_lock.Seigo Tanimura2002-03-111-4/+2
| | | | Notes: svn path=/head/; revision=92069
* Lock struct pgrp, session and sigio.Seigo Tanimura2002-02-231-15/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current) Notes: svn path=/head/; revision=91140
* Style(9) nits.Poul-Henning Kamp2002-02-101-9/+9
| | | | | | | Obtained from: ~bde/sys.dif.gz Notes: svn path=/head/; revision=90490
* - Attempt to help declutter kern. sysctl by moving security out fromAndrew R. Reiter2002-01-161-2/+2
| | | | | | | | | beneath it. Reviewed by: rwatson Notes: svn path=/head/; revision=89414
* o Introduce kern.security.bsd.unprivileged_read_msgbuf, which allowsRobert Watson2001-11-301-0/+13
| | | | | | | | | | | | | | the administrator to restrict access to the kernel message buffer. It defaults to '1', which permits access, but if set to '0', requires that the process making the sysctl() have appropriate privilege. o Note that for this to be effective, access to this data via system logs derived from /dev/klog must also be limited. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=87150
* Properly sanity-check the old msgbuf structure before we accept itIan Dowse2001-11-091-3/+6
| | | | | | | | | | | | | | | | as being valid. Previously only the magic number and the virtual address were checked, but it makes little sense to require that the virtual address is the same (the message buffer is located at the end of physical memory), and checks on the msg_bufx and msg_bufr indices were missing. Submitted by: Bodo Rueskamp <br@clabsms.de> Tripped over during a kernel debugging tutorial given by: grog Reviewed by: grog, dwmalone MFC after: 1 week Notes: svn path=/head/; revision=86238
* KSE Milestone 2Julian Elischer2001-09-121-2/+3
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Make the code to read the kernel message buffer via sysctl machine-Thomas Moestl2001-07-031-0/+45
| | | | | | | | independent and rename the corresponding sysctls from machdep.msgbuf and machdep.msgbuf_clear (i386 only) to kern.msgbuf and kern.msgbuf_clear. Notes: svn path=/head/; revision=79153
* Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variablesJake Burkholder2001-01-101-1/+1
| | | | | | | other then curproc. Notes: svn path=/head/; revision=70861
* Make sure we have a non-null proc pointer before referring to fieldsMatt Jacob2000-12-231-1/+1
| | | | | | | off of it. Notes: svn path=/head/; revision=70301
* A last minute brucification resulted in syntax errors in the previous commit.Poul-Henning Kamp2000-12-201-4/+4
| | | | Notes: svn path=/head/; revision=70240
* Replace logwakeup() with "int msgbuftrigger". There is littlePoul-Henning Kamp2000-12-201-52/+110
| | | | | | | | | | | | | | point in calling a function just to set a flag. Keep better track of the syslog FAC/PRI code and try to DTRT if they mingle. Log all writes to /dev/console to syslog with <console.info> priority. The formatting is not preserved, there is no robust, way of doing it. (Ideas with patches welcome). Notes: svn path=/head/; revision=70239
* Simplify the tprintf() API.Poul-Henning Kamp2000-11-261-34/+18
| | | | | | | Loose the special <sys/tprintf.h> #include file. Notes: svn path=/head/; revision=69214
* Make log(-1, ...) do what addlog(...) did.Poul-Henning Kamp2000-11-261-38/+15
| | | | | | | | | | | Replace all uses of addlog(...) with log(-1, ...) Remove bogus "register" keywords in subr_prf.c Make log() return void. Notes: svn path=/head/; revision=69211
* Treat %X the same as %x (not entirely correct, but close enough).Mike Smith2000-10-021-0/+1
| | | | Notes: svn path=/head/; revision=66530
* Major update to the way synchronization is done in the kernel. HighlightsJason Evans2000-09-071-1/+2
| | | | | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh Notes: svn path=/head/; revision=65557
* Do not fault if curproc is null.Peter Wemm2000-04-291-1/+1
| | | | Notes: svn path=/head/; revision=59745
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Merge the cons.c and cons.h to the best of my ability. alpha may orPoul-Henning Kamp1999-08-091-2/+2
| | | | | | | may not compile, I can't test it. Notes: svn path=/head/; revision=49558
* Make long longs ("%ll" format) work.Brian Feldman1999-08-071-2/+6
| | | | | | | Reviewed by: msmith Notes: svn path=/head/; revision=49502
* This makes the in kernel printf routines conform to the documentedDoug Rabson1999-07-241-13/+24
| | | | | | | | | behavior of their userland counterparts with respect to return values. Submitted by: Matthew N. Dodd <winter@jurai.net> Notes: svn path=/head/; revision=49047
* Oops, missed out one chunk of the last patch. (*blush*)Peter Wemm1999-07-141-2/+2
| | | | | | | | Submitted by: Kazutaka YOKOTA <yokota@zodiac.mech.utsunomiya-u.ac.jp> Submitted by: "Matthew N. Dodd" <winter@jurai.net> Notes: svn path=/head/; revision=48811
* Fixes for a couple of problems in last commit:Peter Wemm1999-07-101-8/+8
| | | | | | | | | | | | | | | | | | | | 1. Printing large quads in small bases overflowed the buffer if sizeof(u_quad_t) > sizeof(u_long). 2. The sharpflag checks had operator precedence bugs due to excessive parentheses in all the wrong places. 3. The explicit 0L was bogus in the quad_t comparison and useless in the long comparision. 4. There was some more bitrot in the comment about ksprintn(). Our ksprintn() handles bases up to 36 as well as down to 2. Bruce has other complaints about using %q in kernel and would rather we went towards using the C9X style %ll and/or %j. (I agree for that matter, as long as gcc/egcs know how to deal with that.) Submitted by: bde Notes: svn path=/head/; revision=48728
* Implement the %q prefix for the integer types. Note that egcs on thePeter Wemm1999-07-091-17/+81
| | | | | | | | | | Alpha believes that %q is for long long, whereas our quad_t and int64_t is only just a plain long. long long on the alpha is the same size (64 bit) as a long. It was requested, but I have not implemented yet, support for C9X style %lld - it should be pretty easy though. Notes: svn path=/head/; revision=48714
* ksprintn() may be called with base=2, so redefine MAXNBUF accordingly.Archie Cobbs1999-06-071-18/+19
| | | | | | | | | Other brucification tweaks. Obtained from: bde@freebsd.org Notes: svn path=/head/; revision=47822
* The function ksprintn(), which is used to convert numbers to ASCII, is notArchie Cobbs1999-06-061-8/+14
| | | | | | | | reentrant because it returns a static buffer. This results in a race condition when/if an interrupt handler calls log(), printf() etc. Fix this. Notes: svn path=/head/; revision=47773
* Unifdef VM86.Jonathan Lemon1999-06-011-1/+18
| | | | | | | Reviewed by: silence on on -current Notes: svn path=/head/; revision=47678
* Add snprintf(3) and vsnprintf(3) capability to the kernel.Archie Cobbs1998-12-031-2/+55
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=41479
* Store formatted panic string in static buffer to make it available laterAndrey A. Chernov1998-09-061-1/+14
| | | | | | | | for savecore. Previous code give only panic format to savecore Notes: svn path=/head/; revision=38874
* Fixed the formatting of some tables (mainly the one produced by psBruce Evans1998-08-101-2/+2
| | | | | | | | | | | | | in ddb) which I broke by changing %8[l]x to %8p. Hacked the central printf routine to not add an "0x" prefix for %p formats if the field width is nonzero. The tables are still horribly misformatted on 64-bit machines. Use %p instead of %8p to print pointers when the field width isn't important. Notes: svn path=/head/; revision=38224
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,Bruce Evans1998-07-151-2/+2
| | | | | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types. Notes: svn path=/head/; revision=37649