Commit Graph

62 Commits

Author SHA1 Message Date
thorpej
94962b67c7 Fix some printf format problems on Alpha. 1999-02-12 00:46:11 +00:00
explorer
c3167035de no need to set tailp twice. 1999-02-10 18:03:05 +00:00
explorer
47bc7c51b7 rewrite usage of tailp slightly, to convince gcc that it really isn't used
initialized.
1999-02-06 11:57:35 +00:00
msaitoh
de35d7228d fix compiler warning 1999-02-03 01:16:20 +00:00
msaitoh
a01e3cd255 Implement [v]snprintf() 1999-01-28 00:05:49 +00:00
drochner
846db6691a make console_debugger() a macro - no need to waste a stackframe 1999-01-26 17:05:41 +00:00
jonathan
3ac3cbcfb8 Add options DDB_FROMCONSOLE and sysctl ddb.fromconsole, analagous to
DDB_ONPANIC. Lets user ignore breaks but enter DDB on panic.  Intended
for machines where debug on panic is useful, but DDB entry is not,
(public-access console, or terminal-servers which send spurious breaks)

Add new ddb hook, console_debugger(), which decides whether or not to
ignore console ddb requests. Console drivers should be updated to call
console_debugger(), not Debugger(), in response to serial-console
break or ddb keyboard sequence.
1998-10-29 21:22:32 +00:00
thorpej
d46253f21c Implement vsprintf(). 1998-09-29 21:03:02 +00:00
thorpej
73aefe65bc If MULTIPROCESSOR, add a spin lock around the kernel printf (in the
appropriate places).  This makes debugging messages work a LOT better
on my multiprocessor Alpha.
1998-09-29 01:49:43 +00:00
pk
818fef1cd7 Nuke spurious pointer incrementation. 1998-09-12 13:12:14 +00:00
mrg
69f13c5156 minor KNF nit 1998-08-31 02:47:00 +00:00
pk
9e744b8155 Merge Chris Torek's new `%b' bit-field format into bitmask_snprintf(). 1998-08-23 22:42:32 +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
jonathan
466e784ee1 defopt DDB. 1998-07-04 22:18:13 +00:00
fvdl
e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
ross
3877611a5c Put it back the way it was. 1997-11-17 00:59:56 +00:00
ross
42046e9698 A new kprintf was imported on 10/24, and it will cause a kernel panic
whenever the %: format is used on NetBSD/Alpha. Disable %: for __alpha__.
Note: the "correct" (but untested on other architectures) fix is to
change the wrong: kprintf(cp, oflags, tp, NULL, va_arg(ap, va_list));
    to the right: kprintf(cp, oflags, tp, NULL, ap);
1997-11-15 09:27:33 +00:00
chuck
94fa91f862 import chris torek's vfprintf() from libc [renamed to kprintf and all
floating point stuff removed].

the new kprintf replaces the 3 different (and buggy) versions of
printf that were in the kernel before (kprintf, sprintf, and db_printf),
thus reducing duplicated code by 2/3's.   this fixes (or adds) several
printf formats.  examples:
 %#x   - previously only supported by db_printf [not printf/sprintf]
 %8.8s - printf would print "000chuck" for "chuck" before
 %5p   - printf would print "0x    1" for value 1 before

XXX: new kprintf still supports several non-standard '%' formats that
are supposed to eventually be removed:
  %: - passes an additional format string and argument list recursively
  %b - used to decode error registers
  %r - int, but print in radix "db_radix" [DDB only]
  %z - 'signed hex' [DDB only]
  %n - unsigned int, but print in radix "db_radix" [DDB only]

note that DDB's "%n" conflicts with standard "%n" which takes the
number of characters written so far and stores it into the integer
indicated by the "int *" pointer arg.  yuck!

while here, add comments for each function explaining what it is
supposed to do.
1997-10-24 18:14:25 +00:00
leo
d4713d24c2 Implement the kernel part of pr-1891. This allows for a more flexible sized
msgbuf. Note that old 'dmesg' and 'syslogd' binaries will continue running,
though old 'dmesg' binaries will output a few bytes of junk at the start of
the buffer, and will miss a few bytes at the end of the buffer.
1997-09-19 13:52:37 +00:00
thorpej
6043eb7d80 Avoid running off the end of the format string if the caller botched
the format modifer.  Reported by and suggested fix from Daniel G. Pouzzner
in PR #2633.  Final fix is slightly different now that we support the %q
modifier.  This fix also includes the equivalent fix for sprintf().
1997-06-26 05:17:45 +00:00
thorpej
e14025e742 If KGDB is defined, pull in <sys/kgdb.h> for prototypes. 1997-06-26 00:43:10 +00:00
drochner
a52a25467d Implement quad_t (%qx, %qd, %qo) printf formats.
Closes pr kern/3747.
1997-06-16 15:02:27 +00:00
thorpej
5ca650f210 XXX Kludge for PowerPC; needs a kernel vfprintf(). 1997-04-17 00:06:28 +00:00
gwr
37b247edde Renames: /dumpconf/cpu_dumpconf/, /boot/cpu_reboot/ 1997-03-26 22:42:13 +00:00
thorpej
1dc6efd7e6 Only call Debugger() on panic if "db_onpanic" is set. 1997-01-09 05:38:22 +00:00
thorpej
156e926117 Implement bitmask_snprintf(), which takes a value and a string
representing the names of those bits, prints them into a buffer
provided by the caller, and returns a pointer to that buffer.
Functionality is identical to that of the (non-standard) `%b' printf()
format, which will be deprecated.

Rename the non-exported function ksprintn() to ksnprintn(), and change
it to use a buffer provided by the caller, rather than at static
buffer.
1996-11-13 06:06:05 +00:00
gwr
f5927ca260 Minor nit in my change regarding const and non-ansi code... 1996-10-27 21:50:33 +00:00
gwr
2ada6af51b Oops, part of that last commit was not meant to go in.
The definitions of va_alist, va_dcl belong elsewhere.
1996-10-27 20:50:00 +00:00
gwr
a0d9bd5bb2 The hack-ish tricks to make the ANSI-style va_start macro work in
non-ANSI mode were not quite complete.  This makes non-ANSI work.
Perhaps it would be better to eliminate this hack altogether...
1996-10-27 20:30:52 +00:00
cgd
ca829ca73c don't assign non-const pointers from const pointers; make the appropriate
pointers 'const'.  (-Wcast-qual)
1996-10-25 22:01:44 +00:00
ws
31bdb14ed5 Rename recently checked in KGDB to IPKDB to resolve conflicts with older KGDB 1996-10-16 19:32:08 +00:00
cgd
709ebdf6ab panic must print a newline 1996-10-15 21:35:56 +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
ws
0d59d2eb20 Enter new KGDB on panic just like other kernel debuggers 1996-09-30 17:32:01 +00:00
christos
3f15a06497 Recognize %.2x as %02x 1996-09-25 21:03:06 +00:00
mrg
5abbf990f3 Change reboot(2) to take two arguments: bootopt like normal and also
a boot string for firmware that can do this, such as the SPARC and
the sun3 models.  It is currently silently ignored on all other
hardware now, however.  The MD function "boot()" has been changed to
also take a char *.
1996-08-09 10:30:23 +00:00
christos
4ef330b934 remove include of <sys/cpu.h> 1996-04-22 01:38:12 +00:00
christos
e2d37158ba Change %r -> %: as for recursive printf's 1996-03-30 22:25:18 +00:00
christos
c9e746a335 Fix printf() formats. 1996-03-16 23:17:04 +00:00
christos
e79beaff89 - fdopen -> filedescopen
- bring kgdb prototype in scope.
1996-03-14 19:01:08 +00:00
christos
09afd77655 More proto fixes 1996-02-09 18:59:18 +00:00
christos
8a5b1b92e2 First pass at prototyping 1996-02-04 02:15:01 +00:00
cgd
d0601a093f copy some format specifiers from kprintf to sprintf. b & r still missing 1995-06-16 10:52:17 +00:00
mycroft
fe62f9afca Actually, do the previous differently. 1995-03-19 23:23:11 +00:00
mycroft
feb5b4b126 Add a `%p' format. 1995-03-19 23:17:16 +00:00
mycroft
ebe3db17a7 Handle null pointers like libc. 1994-12-28 06:30:35 +00:00
cgd
cf92afd66e New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:29:24 +00:00
cgd
f072e5b0eb update; minor clean, cruft removal. 1994-05-13 06:02:45 +00:00
mycroft
89b3d99770 Make logpri() non-static. 1994-05-12 10:26:19 +00:00