Commit Graph

4001 Commits

Author SHA1 Message Date
Bruce Evans
057b294dc0 Un-inline a call to spl0(). It is not time critical, and was only inline
because there was no non-inline spl0() to call.

Don't frob intr_nesting_level in idle() or cpu_switch().  Interrupts
are mostly disabled then, so the frobbing had little effect.
1997-07-01 01:34:30 +00:00
Bruce Evans
b563e748a9 Added ifdefs so that this compiles when neither I586_CPU nor I586_CPU
is defined, or SMP is defined.  It is silly to configure PERFMON when
it can't work (it will be disabled at runtime), but I like to leave
the PERFMON configuration alone when I temporarily disable support for
modern CPUs to run regression tests.

Removed an unused #include.
1997-07-01 01:18:38 +00:00
Bruce Evans
dc514523a7 Un-inline a call to spl0(). It is not time critical, and was only inline
because there was no non-inline spl0() to call.
1997-07-01 01:02:03 +00:00
Bruce Evans
be69522eec Some staticized variables were still declared to be extern. 1997-07-01 00:54:37 +00:00
Bruce Evans
43a6378726 Removed extra definition of constty. It is defined in subr_prf.c. 1997-07-01 00:52:37 +00:00
Bruce Evans
48792cfc18 Don't cast function pointers to (void *). This will cause warnings.
They should be fixed when similar warnings for the general interrupt
attach routines are fixed.

Removed unused #include.
1997-07-01 00:45:45 +00:00
Bruce Evans
72ef571982 Don't depend <machine/cpufunc.h> including <sys/types.h>. 1997-07-01 00:29:33 +00:00
Bruce Evans
a24a66635c Don't depend on gcc's feature of permitting labels that aren't followed
by a statement.
1997-07-01 00:22:51 +00:00
Bruce Evans
06daa05136 Enabled some SMP options. LINT is for testing that all code compiles
cleanly, so only negative options should be commented out.  Options
should have non-default values.
1997-07-01 00:14:39 +00:00
Kazutaka YOKOTA
5d3b146552 options.i386:
- Added the psm options PSM_HOOKAPM and PSM_RESETAFTERSUSPEND.

LINT:
- Added the psm options PSM_HOOKAPM and PSM_RESETAFTERSUSPEND.
- Added comments on the flag 0x20 for syscons.
- Clarified descriptions on the flags (0x02, 0x04) regarding the cursor
  shape in syscons.
1997-06-30 14:37:43 +00:00
Kazutaka YOKOTA
ac4c944d67 Fixes annoying behavior and a bug regarding the destructive
cursor (CHAR_CURSOR)

1. Reduced the number of calls to set_destructive_cursor().  The
destructive cursor produced noticeable overhead on the system.  It was
caused by draw_cursor_image() calling set_destructive_cursor() every
so often.

set_destructive_cursor() absolutely needs to be called when

a) the character code under the cursor has changed either because
   the cursor moved or because the screen was updated or the mouse
   pointer overlapped the cursor.
b) Or a new font has been loaded,
c) or the video mode has been changed,
d) or the cursor shape has been changed,
e) or the user switched virtual consoles.

2. Turn off the configuration flag CHAR_CURSOR (destructive cursor) in
scattach() if we have a non-VGA card.  The destructive cursor works
only for VGA.

3. Removed redundant calls to set_destructive_cursor() in some places.

4. Fixed the "disappearing mouse pointer" problem. The mouse pointer
looked hidden under the destructive cursor when it overlaped the cursor.

A slightly different version of the patch was reviewd and OKed by
sos and ache.
1997-06-30 13:31:49 +00:00
Kazutaka YOKOTA
bf3c452e20 Add experimental APM support for some laptops.
If the configuration option PSM_HOOKAPM is defined and the APM device
is available, the psm driver will issue the ENABLE command to the
pointing device at the resume APM event if the device was open when
the system went into suspended mode. If the option
PSM_RESETAFTERSUSPEND is specified in addition to PSM_HOOKAPM, the
driver will try to reset the pointing device before sending the
ENABLE command.

Built-in PS/2-type pointing devices in some laptops (all the reports I
heard were about Toshiba models) sometimes don't work immediately
after the system is resumed. The device MAY become available after a
while. The system may exhibit the same symptom in other OS's too
(no, FreeBSD is not the only OS that is suffering :-).

I don't know the correct way of solving this yet, but it's been
reported that issuing the ENABLE command after resumption wakes up the
pointing device.

Without PSM_HOOKAPM, the psm driver behaves in the same way as before.

Problem reported in the bsd-nomads mailing list in Japan.
1997-06-30 12:52:57 +00:00
Andrey A. Chernov
32721aad4f dev->id_flags --> flags
(not compiles otherwise)
1997-06-29 22:23:32 +00:00
Bruce Evans
1013a13daf Fixed the fix for not using -fomit-frame-pointer with -pg. The previous
fix stopped it being used in all cases, because substitution on unset
variables does not work.

When profiling, put -malign-functions=4 in CFLAGS instead of in PROF.
This fixes the histogram counts for profiling support functions.  It
gives bogus but harmless extra alignment for genassym etc.
1997-06-29 16:39:11 +00:00
Kazutaka YOKOTA
a2fc20d086 A fix/work-around for ThinkPad 535.
Add a new configuration flag, KBD_NORESET (0x20) to tell scprobe() not
to reset the keyboard.

IBM ThinkPad 535 has the `Fn' key with which the user can perform
certain functions in conjunction with other keys. For example, `Fn' +
PageUP/PageDOWN adjust speaker volume, `Fn' + Home/End change
brightness of LCD screen. It can also be used to suspend the system.

It appears that these functions are implemented at the keyboard level
or the keyboard controller level and totally independent from BIOS or
OS.  But, if the keyboard is reset (as is done in scprobe()), they
become unavailable.  (There are other laptops which have similar
functions associated with the `Fn' key. But, they aren't affected by
keyboard reset.)

ThinkPad 535 doesn't have switches or buttons to adjust brightness and
volume, or to put the system into the suspend mode. Therefore, it is
essential to preserve these `Fn' key functions in FreeBSD. The new
flag make scprobe() skip keyboard reset.

If this flag is not set, scprobe() behaves in the same say as before.

(If we only knew a way to detect ThinkPad 535, we could skip keyboard
reset automatically, but...)
1997-06-29 15:11:40 +00:00
Steve Passe
58db75841d apic_vector.s:
- added Xcpustop IPI code to support stop_cpus()/restart_cpus().
   it is off by default, enable via smptests.h:TEST_CPUSTOP

intr_machdep.h:
 - moved +ICULEN to lower level.
 - added entry for Xcpustop.
1997-06-27 23:48:05 +00:00
Steve Passe
b7f7f066f6 Added POST code output to various points of the startup code.
General cleanup.

New functions to stop/start CPUs via IPIs:

 - int stop_cpus( u_int map );
 - int restart_cpus( u_int map );

Turned off by default, enabled via smptests.h:TEST_CPUSTOP.
Current version has a BUG, perhaps a deadlock?
1997-06-27 23:33:17 +00:00
Steve Passe
b1c3894d1b Experimental calls to stop_cpus()/restart_cpus() within breakpoint calls.
Turned off by default in smptests.h.
1997-06-27 23:24:38 +00:00
Steve Passe
3984ec7e1f Added other_cpus to CPU private page.
This variable is a bitmap showing all CPUs present EXCEPT the CPU
owning the variable.  In other words, it is equal to the global bitmap
'all_cpus' minus its own bit.
1997-06-27 23:19:43 +00:00
Steve Passe
734d28f8dd Preliminaries for stop_cpus()/restart_cpus().
Both are turned off by default.

Added macro for displaying POST codes from kernel.
1997-06-27 23:12:31 +00:00
Steve Passe
4ef5e4e12c Program lint1 to handle NMIs.
Till now NMIs would be ignored.  Now an NMI is caught by the BSP.
APs still ignore NMI, am working on code to allow a CPU to stop other CPUs
via an IPI.
1997-06-27 22:27:18 +00:00
Steve Passe
0eaccbadd9 Added fields to the LVT1/2 group. 1997-06-27 22:13:50 +00:00
Justin T. Gibbs
d144ffea1f Modify my copyright notice to allow the sequencer to be used with GPLed
software (aka Linux).
1997-06-27 19:39:34 +00:00
Justin T. Gibbs
374114db56 KNF cleanup. 1997-06-27 19:36:27 +00:00
Steve Passe
0eb9918b17 Removed '#include <machine/smptests.h>' line, no longer needed. 1997-06-27 18:29:55 +00:00
KATO Takenori
4962d93866 Added CPU_DIRECT_MAPPED_CACHE option which sets L1 cache in direct
mapped mode on Cyrix 486DLC box.
1997-06-27 13:46:19 +00:00
Tor Egge
b672570754 Back out a bad commit. 1997-06-26 02:04:34 +00:00
Steve Passe
8b16756603 Merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
 - get_pci_apic_irq() -> pci_apic_pin()
1997-06-25 21:01:52 +00:00
Steve Passe
293f18dbbf Modified to use merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
1997-06-25 21:00:00 +00:00
Steve Passe
89e4e0c098 Modified to declare merged/renamed functions:
- get_isa_apic_mask() -> isa_apic_mask()
 - get_isa_apic_irq() && get_eisa_apic_irq() -> isa_apic_pin()
 - get_pci_apic_irq() -> pci_apic_pin()
1997-06-25 20:59:15 +00:00
Tor Egge
7bcc0f3d66 Allow the kernel configuration file to override the amount of memory
available to the kernel (VM_KMEM_SIZE). The default (32 MB) is too low
when having 512 MB or more physical memory in a server environment. This is
relevant on systems where "panic: kmem_malloc: kmem_map too small" is a
problem.
1997-06-25 20:18:58 +00:00
Tor Egge
a4ec81c7d0 Allow kernel configuration file to override PMAP_SHPGPERPROC. The default
value (200) is too low in some environments, causing a fatal
"panic: get_pv_entry: cannot get a pv_entry_t". The same panic might
still occur due to temporary shortage of free physical memory
(cf. PR i386/2431).
1997-06-25 20:07:50 +00:00
Tor Egge
9facf4a0d9 Block some interrupts during the call to pmap_zero_page in
vm_page_zero_idle. This fixes some occurences of the problem
reported in PR kern/3216: "panic: pmap_zero_page: CMAP busy"
1997-06-25 19:49:45 +00:00
Sean Eric Fagan
61ef57aaf2 Do The Right Thing when an iBCS2 program does getgroups(0, whatever) -- we
were returning EFAULT, when it is a completely acceptable thing to do.
Also, at the same time, be a *bit* optimizing and don't allocate any
"stackgrap" memory if we're not going to use it.

This is another Oracle-discovered problem.

Submitted by:	Steven Wallace
1997-06-25 01:01:21 +00:00
Tor Egge
3b5d3246bf Ensure that the boot CPU honours write protection in kernel mode.
This fixes one of the problems noted in PR kern/3688.
1997-06-24 17:26:07 +00:00
KATO Takenori
7367854ebc Recognize AMD K5 PR166 and PR200 CPUs. 1997-06-24 09:45:35 +00:00
Steve Passe
ee889b3ba0 Fix calculation of initial mplock value.
We now use LOGICAL, not PHYSICAL, IDs to calculate the mplock.
1997-06-24 07:48:02 +00:00
Steve Passe
afbe6f7b6e Fixed breakage for "default" configurations in mptable_pass1(). 1997-06-24 06:55:30 +00:00
Sean Eric Fagan
c6d139318e For the xenix_ftime() routine, don't use the native version of the struct --
the XENIX version is packed, and two bytes smaller than ours.  So, define
the structure, and have it packed.  I used the __attribte__((packed))
modifier for this; I could also have surrounded the struct definition with
#pragma pack(2) -- but that would have meant making ibcs2_timeb's definition
outside the function.  This may need to be revisited if we ever want to
compile with a compiler other than gcc.  (I also used 'unsigned long'
instead of 'time_t' because I am writing to match an external specification
-- and the definition of time_t could change.)

Reviewed by:	Steven Wallace
1997-06-22 19:04:03 +00:00
Peter Wemm
b3196e4b9f Preliminary support for per-cpu data pages.
This eliminates a lot of #ifdef SMP type code.  Things like _curproc reside
in a data page that is unique on each cpu, eliminating the expensive macros
like:    #define curproc (SMPcurproc[cpunumber()])

There are some unresolved bootstrap and address space sharing issues at
present, but Steve is waiting on this for other work.  There is still some
strictly temporary code present that isn't exactly pretty.

This is part of a larger change that has run into some bumps, this part is
standalone so it should be safe.  The temporary code goes away when the
full idle cpu support is finished.

Reviewed by: fsmp, dyson
1997-06-22 16:04:22 +00:00
Peter Wemm
3b18caba29 Kill some stale leftovers from the earlier attempts at SMP per-cpu pages 1997-06-22 15:47:16 +00:00
Mike Smith
0231d9ebb6 From the submitted patch :
The kernel with USERCONFIG_BOOT and VISUAL_USERCONFIG option presents
the user the kernel configuration menu upon boot.

The user can navigate the menu with cursor keys. I think it would be
nice if the user can navigate and select a menu item with regular keys
as well, so that the user who is using a serial console which is not
so capable of esc sequences still can choose a menu item.

With the following patch we can select an item by typing an item
number, 1, 2, or 3, or mnemonic `s' to skip UserConfig, 'v' to enter
the visual mode, and `c' to start the CLI mode. `p', `u', `n', and `d'
will move cursor up and down.

Submitted by:	yokota
1997-06-22 13:51:04 +00:00
Kazutaka YOKOTA
124ff4169d The syscons driver doesn't really check the presence of the display
adapter during the system boot. It always assumes there is at least a
monochrome adapter.

This is rather strange assumption. If there is no dispaly adapter, the
console driver cannot be any good...

In this patch, scinit() is split into two parts; the first part is
now called scvidprobe() which will detect the presence of video card
at the CGA or MONO buffer address and returns TRUE if found. It is
called during sccnprobe() and scprobe(). Both will fail if no video
card is found.

The second part, whose name stays the same as before, scinit(), is
called from sccninit() and scattach() to complete initialization of
the found video card.

The keyboard probe code is moved from scprobe() to sckbdprobe();
scprobe() now calls scvidprobe() and sckbdprobe() to carry out device
probe. (This is rather a cosmetic change, but it sure makes the code
look better organized.)

The problem pointed out by Joerg.
1997-06-22 12:04:36 +00:00
Bruce Evans
c8f8a520f6 Fixed va_arg() to work for small args (as in stdarg.h). 1997-06-21 16:20:55 +00:00
Bruce Evans
ce93f47a1e Don't attempt to generate errors for unpromoted types in va_arg(),
since it is impossible to distinguish unpromoted types from small
(struct) types.  Renamed __va_promote() to __va_size() since it is
related to sizes of args on the stack and not to promotion.

PR:		3884
Submitted by:	mostly by arnej@math.ntnu.no (Arne Henrik Juul)
Obtained from:	name of__va_size and some parentheses fixes from NetBSD
1997-06-21 15:45:13 +00:00
Garrett Wollman
a8da31fc3e Fix crash when halting where APM was configured but not enabled
by checking whether APM is active in apm_power_off() and returning
if not.  (The code was already written with the expectation that
this function would return if it fails.)
1997-06-19 00:25:03 +00:00
Kenjiro Cho
3cbceb8234 correct the wrong ATM option name for native atm access
NETNATM --> NATM

reported by Bruce Evans.

Bruce also pointed out that NATM is confusing since config(8) defines
NATM as the number of atm pseudo device in "BUILD_DIR/atm.h".
We might change the name in the future but leave it as it is for now.
1997-06-17 05:58:15 +00:00
Philippe Charnier
91463ae299 Fix 2 typos. 1997-06-16 06:32:51 +00:00
Garrett Wollman
b551bf4430 Fix another power down braino. 1997-06-15 02:24:06 +00:00
Garrett Wollman
dd57c0981c Fix definition of apm_power off (was suffering from cut&paste syndrome). 1997-06-15 02:19:40 +00:00