Commit Graph

8123 Commits

Author SHA1 Message Date
Peter Wemm
eb30c1c0b9 Rip some well duplicated code out of cpu_wait() and cpu_exit() and move
it to the MI area.  KSE touched cpu_wait() which had the same change
replicated five ways for each platform.  Now it can just do it once.
The only MD parts seemed to be dealing with fpu state cleanup and things
like vm86 cleanup on x86.  The rest was identical.

XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional
stub in place.

Reviewed by:	jake, tmm, dillon
2001-09-10 04:28:58 +00:00
Peter Wemm
e11e07928b gcc-3 has objections about the bluetrap6 and bluetrap13 inline asm
functions.  Apparently multi-line string asm arguments are deprecated.
2001-09-10 04:22:20 +00:00
Peter Wemm
660c5377fd Missing part of dillon's coredump commit. cpu_coredump() was still
passing IO_NODELOCKED to vn_rdwr(), this would cause operations on the
unlocked core vnode and softupdates nastiness if an a.out binary cored.
2001-09-08 22:18:58 +00:00
Marcel Moolenaar
5002a60f9b Round of cleanups and enhancements. These include (in random order):
o  Introduce private types for use in linux syscalls for two reasons:
   1. establish type independence for ease in porting and,
   2. provide a visual queue as to which syscalls have proper
      prototypes to further cleanup the i386/alpha split.
   Linuxulator types are prefixed by 'l_'. void and char have not
   been "virtualized".

o  Provide dummy functions for all syscalls and remove dummy functions
   or implementations of truely obsolete syscalls.

o  Sanitize the shm*, sem* and msg* syscalls.

o  Make a first attempt to implement the linux_sysctl syscall. At this
   time it only returns one MIB (KERN_VERSION), but most importantly,
   it tells us when we need to add additional sysctls :-)

o  Bump the kenel version up to 2.4.2 (this is not the same as the
   KERN_VERSION MIB, BTW).

o  Implement new syscalls, of which most are specific to i386. Our
   syscall table is now up to date with Linux 2.4.2. Some highlights:
   -  Implement the 32-bit uid_t and gid_t bases syscalls.
   -  Implement a couple of 64-bit file size/offset bases syscalls.

o  Fix or improve numerous syscalls and prototypes.

o  Reduce style(9) violations while I'm here. Especially indentation
   inconsistencies within the same file are addressed. Re-indenting
   did not obfuscate actual changes to the extend that it could not
   be combined.

NOTE: I spend some time testing these changes and found that if there
      were regressions, they were not caused by these changes AFAICT.
      It was observed that installing a RH 7.1 runtime environment
      did make matters worse. Hangs and/or reboots have been observed
      with and without these changes, so when it failed to make life
      better in cases it doesn't look like it made it worse.
2001-09-08 19:07:04 +00:00
Marcel Moolenaar
f981a79ed9 o Introduce private types for use in linux syscalls for two reasons:
1. establish type independence for ease in porting and,
   2. provide a visual queue as to which syscalls have proper
      prototypes to further cleanup the i386/alpha split.
   Linuxulator types are prefixed by 'l_'. void and char have not
   been "virtualized".

o  Remove dummy functions for syscalls that are now truely
   unimplemented.

o  Rename syscalls so they match the names used in the Linux kernel.
   Also, provide more accurate prototypes. This generally improves
   cross-referencing and reduces head-scratching.

o  Provide seperate implementations for the 16-bit uid_t and gid_t
   based syscalls as Linux used to have. The new 32-bit uid_t and
   gid_t based syscalls now map to their FreeBSD equivalents.

o  Fix the linux_ipc syscall so that it doesn't force the shm*, sem*
   and msg* syscalls to have the same syscall. The prototypes for
   these syscalls now match the those used on Alpha. While here,
   add the same kludge for MSGRCV as is present in the Linux kernel.

o  Implement the following syscalls:
     linux_stat64, linux_lstat64 and linux_fstat64
     linux_sysctl

o  Added syscalls numbered 198 - 221. This include:
     - the 32-bit uid_t and gid_t bases syscalls
     - 64-bit file offset/size based syscalls
2001-09-08 18:48:40 +00:00
Mike Smith
42df599f7b Now that this code is MD, we don't need the i386 ifdefs. 2001-09-07 03:00:30 +00:00
John Baldwin
df53e91c18 Call sendsig() with the proc lock held and return with it held. 2001-09-06 22:20:41 +00:00
Brooks Davis
0fa2bf5423 Don't specify the number of vlan interfaces any more, they are created
at runtime.
2001-09-05 21:19:56 +00:00
Jonathan Lemon
cfe6cb9694 Remove superfluous statement. 2001-09-05 17:05:19 +00:00
Kazutaka YOKOTA
c395939120 Rework the ISA PnP driver pnp and the PnP resource parser to fix
the following bugs.

- When constructing a resource configuration, respect the order
  in which resource descriptors are read, in order to establish
  the correct mapping between the descriptors and configuration
  registers.
  "Plug and Play ISA Specification, Version 1.0a", Sec 4.6.1, May 5,
  1994.  "Clarifications to the Plug and Play ISA Specification,
  Version 1.0a", Sec 6.2.1, Dec. 10, 1994.

- Do not ignore null (empty) descriptors; they are valid descriptors
  acting as filler.
  "Clarifications to the Plug and Play ISA Specification, Version 1.0a",
  Sec 6.2.1.

- Correctly set up logical device configuration registers for null
  resources.
  "Clarifications to the Plug and Play ISA Specification, Version 1.0a"

- Handle null resources properly in the resource allocator for the
  ISA bus.
2001-09-05 03:54:33 +00:00
David E. O'Brien
1792335469 style(9) the structure definitions. 2001-09-05 01:36:46 +00:00
Mitsuru IWASAKI
db2077f8e1 Reenable RTC interrupts after wakeup. Some laptops have a problem
with system statistics monitoring tools (such as systat, vmstat...)
because of stopping RTC interrupts generation.
Restore all the timers (RTC and i8254) atomically.

Reviewed by:	bde
MFC after:	1 week
2001-09-04 16:02:06 +00:00
Mitsuru IWASAKI
fbd49a7cfb Add `-I.' option to CFLAGS so that we can compile asm code together
with `-nostdinc' option.
2001-09-04 15:46:32 +00:00
Peter Wemm
25ea330aec Mostly cosmetic. Move various variables from .s files to .c files so that
gdb generates debug info for them.
2001-09-04 11:05:33 +00:00
Peter Wemm
cfbf880deb Zap #if 0'ed map init code that got moved to the MI area.
Convert the powerpc tree to use the common code.
2001-09-04 08:42:35 +00:00
Peter Wemm
b53f9c45f9 Nuke #if 0'ed "setredzone()" stub. We never used it, and probably
never will.  I've implemented an optional redzone as part of the KSE
upage breakup.
2001-09-04 08:36:46 +00:00
Kazutaka YOKOTA
bdaeb9cc90 Fix the argument specifier for the PnP BIOS function 2
(PNP_SET_DEVNODE). The second argument is not a segment:offset
pointer, but a 16 bit short.

MFC after:	4 weeks
2001-09-03 03:43:39 +00:00
Takeshi Shibagaki
5f5e1ff3b1 Always turned on 8bit access card support for the fe driver
both i386/pc98, so options FE_8BIT_SUPPORT was deleted.

Reviewed by: nyan
2001-09-02 13:05:00 +00:00
Matthew Dillon
257d198890 Synchronize syscalls.master(s) with recent Giant pushdown work 2001-09-01 19:36:48 +00:00
Matt Jacob
e8a0f829da note 2300/2312 support 2001-08-31 21:39:56 +00:00
Peter Wemm
43295941c4 Do a style cleanup pass for the pmap_{new,dispose,etc}_proc() functions
to get them closer to the KSE tree.  I will do the other $machine/pmap.c
files shortly.
2001-08-31 02:28:01 +00:00
Mike Smith
91bca55f68 Revert previous "fix"; bus mice still have to be manually probed even in
the presence of PnP data.

Submitted by:	yokota
2001-08-31 02:14:34 +00:00
Matthew Dillon
356861db03 Remove the MPSAFE keyword from the parser for syscalls.master.
Instead introduce the [M] prefix to existing keywords.  e.g.
MSTD is the MP SAFE version of STD.  This is prepatory for a
massive Giant lock pushdown.  The old MPSAFE keyword made
syscalls.master too messy.

Begin comments MP-Safe procedures with the comment:
/*
 * MPSAFE
 */
This comments means that the procedure may be called without
Giant held (The procedure itself may still need to obtain
Giant temporarily to do its thing).

sv_prepsyscall() is now MP SAFE and assumed to be MP SAFE
sv_transtrap() is now MP SAFE and assumed to be MP SAFE

ktrsyscall() and ktrsysret() are now MP SAFE (Giant Pushdown)
trapsignal() is now MP SAFE (Giant Pushdown)

Places which used to do the if (mtx_owned(&Giant)) mtx_unlock(&Giant)
test in syscall[2]() in */*/trap.c now do not.  Instead they
explicitly unlock Giant if they previously obtained it, and then
assert that it is no longer held to catch broken system calls.

Rebuild syscall tables.
2001-08-30 18:50:57 +00:00
Mike Smith
5f063c7b09 Add ACPI attachments. 2001-08-30 09:17:03 +00:00
Mike Smith
7b4d3c8814 Correct usage of ISA_PNP_PROBE 2001-08-30 09:16:53 +00:00
Mike Smith
a14859cd80 Note that compiling ACPI into the kernel is deprecated for normal use. 2001-08-30 00:58:57 +00:00
Mike Barcroft
03516cfeb0 o Remove some GCCisms in src/powerpc/include/endian.h.
o Unify <machine/endian.h>'s across all architectures.
o Make bswapXX() functions use a different spelling of u_int16_t and
  friends to reduce namespace pollution.  The bswapXX() functions
  don't actually exist, but we'll probably import these at some
  point.  Atleast one driver (if_de) depends on bswapXX() for big
  endian cases.
o Deprecate byteorder(3) prototypes from <sys/types.h>, these are
  now prototyped indirectly in <arpa/inet.h>.
o Deprecate in_addr_t and in_port_t typedefs in <sys/types.h>, these
  are now typedef'd in <arpa/inet.h>.
o Change byteorder(3) prototypes to use standards compliant uint32_t
  (spelled __uint32_t to reduce namespace pollution).
o Document new preferred headers and standards compliance.

Discussed with:	bde
PR:		29946
Reviewed by:	bmilekic
2001-08-30 00:04:19 +00:00
Warner Losh
d3b6477a19 It turns out that while Toshiba laptops don't want to route interrupts
multiple times, others do.  The last strategy, which was to assume
that already routed interrupts were good and just return them doesn't
work for some laptops.  So, instead, we have a new strategy: we notice
that we have an interrupt that's already routed.  We go ahead and try
to route it, none the less.  We will assume that it is correctly
routed, even if the route fails.  We still assume that other failures
in the bios32 call are because the interrupt is NOT routed.

Note: some laptops do not support the bios32 interface to PCI BIOS and
we need to call it via the INT 2A interface.  That is another windmill
to till at later.

Also correct a minor typo and minor whitespace nits.

Strong MFC candidate.
2001-08-28 16:35:01 +00:00
Warner Losh
d626906b0c MFS: IRQ ordering, PRVERB and more whining in pcibios_get_version on failure.
Check return value from bios32.

[[ Yes, I was bad and committed this to stable first.  I should have done
   the commit in the other order. ]]
2001-08-27 20:44:38 +00:00
Peter Wemm
9d170964e4 There is nothing more embarresing than having three goes at correcting
typos in the same paragraph.  s/in in/in/

Submitted by:	iedowse
2001-08-27 05:18:12 +00:00
Peter Wemm
76cb0cadf1 Enable hardwiring of things like tunables from embedded enironments
that do not start from loader(8).
2001-08-27 05:11:53 +00:00
Peter Wemm
d675a0adcc I missed a typo in the last commit: s/whach/which/
Submitted by:	bde
2001-08-26 21:55:54 +00:00
Peter Wemm
359ebc389c Argh! Revert accidental commit. 2001-08-25 07:42:27 +00:00
Peter Wemm
547a9e66fd vm_page_zero_idle() is no longer MD. 2001-08-25 04:54:25 +00:00
Julian Elischer
15dac10b05 Add another comment.
check for 'teh's this time..
2001-08-25 02:44:38 +00:00
Peter Wemm
268bdb43f9 Optionize UPAGES for the i386. As part of this I split some of the low
level implementation stuff out of machine/globaldata.h to avoid exposing
UPAGES to lots more places.  The end result is that we can double
the kernel stack size with 'options UPAGES=4' etc.

This is mainly being done for the benefit of a MFC to RELENG_4 at some
point.  -current doesn't really need this so much since each interrupt
runs on its own kstack.
2001-08-25 02:20:02 +00:00
Peter Wemm
61af199168 s/teh/the/ 2001-08-25 02:06:59 +00:00
Julian Elischer
6a9344d45a Add an explanatory note that would have saved me an hour or two
of confusion had it been there when I started reading the code..
2001-08-25 01:16:47 +00:00
John Baldwin
e5dfa86a70 Axe a commented, unused #define related to the old giant lock. 2001-08-24 16:52:31 +00:00
John Baldwin
134b29765c INTREN() and INTRDIS() have been MP safe for a while. Don't say that they
are "soon to be" MP safe in the comments.
2001-08-24 16:51:47 +00:00
John Baldwin
a0f831f573 Remove references to the old giant kernel lock in various comments. 2001-08-24 16:46:15 +00:00
Peter Wemm
c1c2006ca7 Export the actual KERNBASE to the symbol table. We can use nlist() to get
this without having to second guess it in userland.
2001-08-24 08:29:54 +00:00
Peter Wemm
5897d41109 Move cpu_fxsr definition to C code (so debug info is generated) and where
it is easily #ifdef'ed so that we dont miss unintentional references to it.
2001-08-24 08:27:24 +00:00
John Baldwin
1432aa0c5e Add a new kernel option RESTARTABLE_PANICS. If this option is present,
then one can restart from a panic by resetting the panicstr variable to
NULL.  This commit conditionalizes the previously committed functionality
on this variable.  It also removes the __dead2 attribute from the panic()
function so that when one continues from a panic() the behavior will
be predictable.
2001-08-23 20:32:21 +00:00
Peter Wemm
66875a2aff Fix a comment error that was fixed in the pc98 version. hw.maxmem is
really hw.physmem.
2001-08-23 01:49:12 +00:00
Peter Wemm
9f9360003f Dont add UPAGES to the %cs segment limit. There is nothing there except
page tables.
2001-08-23 01:25:21 +00:00
Peter Wemm
3b703181e3 Dont compile in SSE fxsave/fxrstor instructions if CPU_ENABLE_SSE isn't
active.
2001-08-23 01:03:56 +00:00
Mitsuru IWASAKI
e4e9098988 Move CR4.PGE enabling code after paging is enabled via CR0.PG based on
the description (2.5. CONTROL REGISTERS) of Intel developer's manual at:
ftp://download.intel.com/design/PentiumII/manuals/24319202.pdf

Reviewed by:	peter, bde, tlambert2@mindspring.com
Pointed-out by:	"Shin'ya Kumabuchi" <kumabu@t3.rim.or.jp>
MFC after:	1 week
2001-08-22 15:41:43 +00:00
Matthew Dillon
219d632c15 Move most of the kernel submap initialization code, including the
timeout callwheel and buffer cache, out of the platform specific areas
and into the machine independant area.  i386 and alpha adjusted here.
Other cpus can be fixed piecemeal.

Reviewed by:    freebsd-smp, jake
2001-08-22 04:07:27 +00:00
Peter Wemm
3d6fde76ed Introduce two new sysctl's.. vm.kvm_size and vm.kvm_free. These are
purely informational and can give some advance indications of tuning
problems.  These are i386 only for now as it seems that the i386 is
the only one suffering kvm pressure.
2001-08-22 00:50:46 +00:00