Update MINIX-specific messages and comments
This commit is contained in:
parent
412e9894b1
commit
a4d9be31c5
|
|
@ -168,10 +168,9 @@
|
||||||
#define MKF_I386_AMD_SYSCALL (1L << 1) /* SYSCALL available and supported */
|
#define MKF_I386_AMD_SYSCALL (1L << 1) /* SYSCALL available and supported */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Number of per-CPU states for which time will be accounted. This *must* be
|
* Number of per-CPU states for which time will be accounted. This value must
|
||||||
* the same value as NetBSD's CPUSTATES, which is defined in a rather
|
* remain in sync with CPUSTATES defined in sys/sched.h. When CPUSTATES
|
||||||
* unfortunate location (sys/sched.h). If the NetBSD value changes, our kernel
|
* changes, the MINIX kernel code must be updated accordingly.
|
||||||
* must be adapted accordingly.
|
|
||||||
*/
|
*/
|
||||||
#define MINIX_CPUSTATES 5
|
#define MINIX_CPUSTATES 5
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
#include <sys/sched.h> /* for CP_*, CPUSTATES */
|
#include <sys/sched.h> /* for CP_*, CPUSTATES */
|
||||||
#if CPUSTATES != MINIX_CPUSTATES
|
#if CPUSTATES != MINIX_CPUSTATES
|
||||||
/* If this breaks, the code in this file may have to be adapted accordingly. */
|
/* If this breaks, the code in this file may have to be adapted accordingly. */
|
||||||
#error "MINIX_CPUSTATES value is out of sync with NetBSD's!"
|
#error "MINIX_CPUSTATES value is out of sync with CPUSTATES!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "kernel/spinlock.h"
|
#include "kernel/spinlock.h"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include <sys/sched.h> /* for CP_*, CPUSTATES */
|
#include <sys/sched.h> /* for CP_*, CPUSTATES */
|
||||||
#if CPUSTATES != MINIX_CPUSTATES
|
#if CPUSTATES != MINIX_CPUSTATES
|
||||||
/* If this breaks, the code in this file may have to be adapted accordingly. */
|
/* If this breaks, the code in this file may have to be adapted accordingly. */
|
||||||
#error "MINIX_CPUSTATES value is out of sync with NetBSD's!"
|
#error "MINIX_CPUSTATES value is out of sync with CPUSTATES!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_APIC
|
#ifdef USE_APIC
|
||||||
|
|
|
||||||
|
|
@ -264,11 +264,12 @@ cpuavg_getstats(const struct cpuavg * ca_orig, uint32_t * cpticks,
|
||||||
*cpticks = ca.ca_run >> FSHIFT;
|
*cpticks = ca.ca_run >> FSHIFT;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* NetBSD's estcpu value determines a scheduling queue, and decays to
|
* In traditional BSD kernels, the 'estcpu' value determines a
|
||||||
* 10% in 5*(the current load average) seconds. Our 'estcpu' simply
|
* scheduling queue and decays to 10% in 5*(the current load average)
|
||||||
* reports the process's percentage of CPU usage in the last second,
|
* seconds. MINIX reports the process's percentage of CPU usage in the
|
||||||
* thus yielding a value in the range 0..100 with a decay of 100% after
|
* last second instead, yielding a value in the range 0..100 with a
|
||||||
* one second. This should be good enough for most practical purposes.
|
* decay of 100% after one second. This should be good enough for most
|
||||||
|
* practical purposes.
|
||||||
*/
|
*/
|
||||||
*estcpu = (ca.ca_last / hz * 100) >> FSHIFT;
|
*estcpu = (ca.ca_last / hz * 100) >> FSHIFT;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -522,8 +522,9 @@ uds_send_peer(struct udssock * uds, const struct sockaddr * addr,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the receiving end will never receive this packet, we
|
* If the receiving end will never receive this packet, we
|
||||||
* might as well not send it, so drop it immeiately. Indicate
|
* might as well not send it, so drop it immediately. Indicate
|
||||||
* as such to the caller, using NetBSD's chosen error code.
|
* this condition to the caller using the MINIX error code for a
|
||||||
|
* full buffer.
|
||||||
*/
|
*/
|
||||||
if (uds_is_shutdown(peer, SFL_SHUT_RD))
|
if (uds_is_shutdown(peer, SFL_SHUT_RD))
|
||||||
return ENOBUFS;
|
return ENOBUFS;
|
||||||
|
|
@ -669,7 +670,8 @@ uds_send_data(struct udssock * uds, struct udssock * peer,
|
||||||
if (seglen > avail) {
|
if (seglen > avail) {
|
||||||
assert(uds_get_type(uds) == SOCK_DGRAM);
|
assert(uds_get_type(uds) == SOCK_DGRAM);
|
||||||
|
|
||||||
/* Drop the packet, borrowing NetBSD's chosen error code. */
|
/* Drop the packet and return the MINIX error code for
|
||||||
|
* insufficient buffer space. */
|
||||||
return ENOBUFS;
|
return ENOBUFS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -346,7 +346,7 @@ int rw_pipe(int rw_flag, endpoint_t usr_e, struct filp *f, int callnr, int fd,
|
||||||
|
|
||||||
/* If pipe_check returns an error instead of suspending the call, we
|
/* If pipe_check returns an error instead of suspending the call, we
|
||||||
* return that error, even if we are resuming a partially completed
|
* return that error, even if we are resuming a partially completed
|
||||||
* operation (ie, a large blocking write), to match NetBSD's behavior.
|
* operation (ie, a large blocking write), to follow MINIX semantics.
|
||||||
*/
|
*/
|
||||||
return(r);
|
return(r);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user