mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-03 09:00:21 +00:00
Merged from sys/i386/i386/machdep.c revisions 1.459 and 1.460.
This commit is contained in:
parent
662a42f752
commit
3b2b0a59d0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79378
@ -107,9 +107,6 @@
|
||||
#include <machine/perfmon.h>
|
||||
#endif
|
||||
|
||||
#ifdef OLD_BUS_ARCH
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
#ifdef PC98
|
||||
@ -197,48 +194,6 @@ sysctl_hw_availpages(SYSCTL_HANDLER_ARGS)
|
||||
SYSCTL_PROC(_hw, OID_AUTO, availpages, CTLTYPE_INT|CTLFLAG_RD,
|
||||
0, 0, sysctl_hw_availpages, "I", "");
|
||||
|
||||
static int
|
||||
sysctl_machdep_msgbuf(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* Unwind the buffer, so that it's linear (possibly starting with
|
||||
* some initial nulls).
|
||||
*/
|
||||
error=sysctl_handle_opaque(oidp,msgbufp->msg_ptr+msgbufp->msg_bufr,
|
||||
msgbufp->msg_size-msgbufp->msg_bufr,req);
|
||||
if(error) return(error);
|
||||
if(msgbufp->msg_bufr>0) {
|
||||
error=sysctl_handle_opaque(oidp,msgbufp->msg_ptr,
|
||||
msgbufp->msg_bufr,req);
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, msgbuf, CTLTYPE_STRING|CTLFLAG_RD,
|
||||
0, 0, sysctl_machdep_msgbuf, "A","Contents of kernel message buffer");
|
||||
|
||||
static int msgbuf_clear;
|
||||
|
||||
static int
|
||||
sysctl_machdep_msgbuf_clear(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr) {
|
||||
/* Clear the buffer and reset write pointer */
|
||||
bzero(msgbufp->msg_ptr,msgbufp->msg_size);
|
||||
msgbufp->msg_bufr=msgbufp->msg_bufx=0;
|
||||
msgbuf_clear=0;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, msgbuf_clear, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&msgbuf_clear, 0, sysctl_machdep_msgbuf_clear, "I",
|
||||
"Clear kernel message buffer");
|
||||
|
||||
int Maxmem = 0;
|
||||
#ifdef PC98
|
||||
int Maxmem_under16M = 0;
|
||||
|
@ -107,9 +107,6 @@
|
||||
#include <machine/perfmon.h>
|
||||
#endif
|
||||
|
||||
#ifdef OLD_BUS_ARCH
|
||||
#include <i386/isa/isa_device.h>
|
||||
#endif
|
||||
#include <i386/isa/icu.h>
|
||||
#include <i386/isa/intr_machdep.h>
|
||||
#ifdef PC98
|
||||
@ -197,48 +194,6 @@ sysctl_hw_availpages(SYSCTL_HANDLER_ARGS)
|
||||
SYSCTL_PROC(_hw, OID_AUTO, availpages, CTLTYPE_INT|CTLFLAG_RD,
|
||||
0, 0, sysctl_hw_availpages, "I", "");
|
||||
|
||||
static int
|
||||
sysctl_machdep_msgbuf(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
|
||||
/* Unwind the buffer, so that it's linear (possibly starting with
|
||||
* some initial nulls).
|
||||
*/
|
||||
error=sysctl_handle_opaque(oidp,msgbufp->msg_ptr+msgbufp->msg_bufr,
|
||||
msgbufp->msg_size-msgbufp->msg_bufr,req);
|
||||
if(error) return(error);
|
||||
if(msgbufp->msg_bufr>0) {
|
||||
error=sysctl_handle_opaque(oidp,msgbufp->msg_ptr,
|
||||
msgbufp->msg_bufr,req);
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, msgbuf, CTLTYPE_STRING|CTLFLAG_RD,
|
||||
0, 0, sysctl_machdep_msgbuf, "A","Contents of kernel message buffer");
|
||||
|
||||
static int msgbuf_clear;
|
||||
|
||||
static int
|
||||
sysctl_machdep_msgbuf_clear(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
error = sysctl_handle_int(oidp, oidp->oid_arg1, oidp->oid_arg2,
|
||||
req);
|
||||
if (!error && req->newptr) {
|
||||
/* Clear the buffer and reset write pointer */
|
||||
bzero(msgbufp->msg_ptr,msgbufp->msg_size);
|
||||
msgbufp->msg_bufr=msgbufp->msg_bufx=0;
|
||||
msgbuf_clear=0;
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
SYSCTL_PROC(_machdep, OID_AUTO, msgbuf_clear, CTLTYPE_INT|CTLFLAG_RW,
|
||||
&msgbuf_clear, 0, sysctl_machdep_msgbuf_clear, "I",
|
||||
"Clear kernel message buffer");
|
||||
|
||||
int Maxmem = 0;
|
||||
#ifdef PC98
|
||||
int Maxmem_under16M = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user