Commit Graph

67 Commits

Author SHA1 Message Date
mycroft 66610a4779 Introduce PROC_PC(), which is used to get a process's user PC. If this is
defined, call addupc_intr() directly from statclock() in the system time case,
using the same P_OWEUPC path if the copyin/copyout fails.
Use this in i386 to remove profiling code from the normal userret() path.
2000-12-10 19:29:30 +00:00
jdolecek 97669de104 make i386_nocpuid_cpus[] and i386_cpuid_cpus[] const - this pushes
another ~1.4KB to text section
2000-11-16 17:00:17 +00:00
thorpej 4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
mycroft 43a543fa88 Implement CLKF_INTR(), to count interrupt time separately. 2000-06-04 21:27:38 +00:00
thorpej a7d0570e67 First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

	- Global state: sched_qs (run queues), sched_whichqs (bitmap
	  of non-empty run queues), sched_slpque (sleep queues).
	  NOTE: These may collectively move into a struct schedstate
	  at some point in the future.

	- Per-CPU state, struct schedstate_percpu: spc_runtime
	  (time process on this CPU started running), spc_flags
	  (replaces struct proc's p_schedflags), and
	  spc_curpriority (usrpri of processes on this CPU).

	- Every platform must now supply a struct cpu_info and
	  a curcpu() macro.  Simplify existing cpu_info declarations
	  where appropriate.

	- All references to per-CPU scheduler state now made through
	  curcpu().  NOTE: this will likely be adjusted in the future
	  after further changes to struct proc are made.

Tested on i386 and Alpha.  Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
2000-05-26 21:19:19 +00:00
thorpej 8c5710a861 - Declare biosbasemem and biosextmem in <machine/cpu.h>, don't extern
them everywhere they're used.
- Avoid integer overflow when converting bios{base,ext}mem (in units of
  kilobytes) to bytes.
2000-04-21 18:37:20 +00:00
simonb 9308187dbf Remove redundant decl of consinit() - it's in <sys/systm.h>.
Remove duplicate definition of delay() - we only need one in this file.
2000-03-29 03:54:03 +00:00
thorpej fd21635b22 Extern cpu_id and cpu_vendor[] here. 2000-03-28 19:16:05 +00:00
drochner 799634df70 next step in getting machdep.c maintainable - put bus_space related
stuff into a separate file
2000-01-26 18:47:59 +00:00
drochner b7b6c4bb4f machdep.c is becoming an unmaintainable mess
put console initialisation into a separate file
1999-12-21 12:34:11 +00:00
enami de37487d49 - Export initrtclock().
- Call it from apm_resume().

This fixes timer problem on some laptop after hybernation (PR#4808).
Reviewd by: fvdl@netbsd.org
1999-11-06 01:14:00 +00:00
fvdl a4e89ca2a1 Define CPU_FPU_PRESENT sysctl value. 1999-10-06 20:04:53 +00:00
thorpej 28fb7c1eb8 Define cpu_number() as discussed on tech-smp. 1999-08-10 21:08:05 +00:00
thorpej eff41cf3b1 Implement cpu_wait(), and move the call to tss_free() from switch_exit()
to cpu_wait(); tss_free() may block, and thus requires a valid context.
1999-07-20 22:25:18 +00:00
thorpej 2f832df90c Do proc0's TSS and LDT initialization at the end of configure() (i.e.
once the FPU has been attached).
1999-04-01 00:37:50 +00:00
fvdl 8371eb7a88 Clean up the BIOS disk matching code a bit (better naming, one structure
and sysctl to export to userland). Also, only use total number of sectors
given in the extended parameters if the physical chs geometry is
marked invalid. Hopefully fixes a problem where BIOSs would not correctly
fill in this field.
1999-03-12 01:01:41 +00:00
fvdl bdb770bc34 Create a list of native disks too, and make it retrievable. It contains
all matching BIOS disks per entry, so that we have complete match info.
Enable the matching code.
1999-03-10 01:28:24 +00:00
fvdl 5db52a7a6b Add some fields to the already defined, but unused, bootinfo structure
for BIOS geometry. Define CPU_BIOS_GEOM sysctl value in cpu.h.
1999-03-08 00:10:42 +00:00
thorpej 49c62c4336 Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
  entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
  When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
1998-11-11 06:41:23 +00:00
thorpej 010b1e5215 Erg, frame -> trapframe in last. (thanks to john kohl) 1998-10-07 21:25:35 +00:00
thorpej b38544d99e Oops, back out a buglet I didn't intend to commit in the last change. 1998-10-07 18:29:26 +00:00
thorpej d374462dfc Move the code that does the deferred (post-autoconfiguration) buffer
cache allocation to its own function, and call it at the end of configure().
1998-10-06 21:42:08 +00:00
thorpej d681cf055a configure() prototype is in <sys/device.h> 1998-10-06 20:50:15 +00:00
thorpej 54a35a6019 Generate dependencies on the USER_LDT option. 1998-01-22 00:39:16 +00:00
thorpej 9ba18e2255 Generate dependencies on the MATH_EMULATE option. 1998-01-21 23:29:08 +00:00
thorpej cf591e644b Generate dependencies on the VM86 option. 1998-01-15 22:25:52 +00:00
bouyer d45f82208d Add a cpu_setup() function to "struct cpu_nocpuid_nameclass" and
"struct cpu_cpuid_family", so that we can have a cpu_setup function per
known cpu type. For now use it only for cyrix 6x86 to enable suspend-on-halt
and implement cyrix's workaround to the "coma bug".
1997-11-27 11:53:45 +00:00
drochner b8a47d06da Define "machdep.booted_kernel" for sysctl. 1997-09-20 12:40:25 +00:00
perry 19d153fc48 Nuke some options GENERIC residue. 1997-02-04 04:57:10 +00:00
fvdl 2775763610 Added types/definitions for changed CPU recognition code. 1996-12-03 23:54:54 +00:00
fvdl c15f6d921f Changes for NKPDE calculation from cgd.
- New variables: biosextmem, biosbasemem, nkpde
- Above can be set by using the options BIOSEXTMEM, BIOSBASEMEM,
  and NKPDE respectively (EXTMEM_SIZE is now called BIOSEXTMEM).
  When preset this way, they won't be filled in / calculated.
- Readable by sysctl using machdep.nkpde, machdep.biosbasemem
  and machdep.biosextmem.
- nkpde is calculated as:

	min(NKPDE_MAX, NKPDE_BASE + (biosextmem >> 10) * NKPDE_SCALE)

  Where NKPDE_MAX is 31, NKPDE_BASE is 4, NKPDE_SCALE = 1.
1996-11-18 01:06:09 +00:00
christos 06555645c2 printf -> kprintf, sprintf -> ksprintf 1996-10-11 00:24:36 +00:00
christos 59fdcbc7ad Change the prototype of fillw from (int, caddr_t, size_t) to
(short, void *, size_t).
1996-05-05 19:29:26 +00:00
christos dc3ce37d53 Add prototypes from other files. 1996-05-03 19:22:49 +00:00
mycroft 6424af4c10 Prototype delay(). 1996-03-29 00:23:28 +00:00
mycroft 1ca89b7f91 Enable paging of the user area. 1995-12-24 01:07:32 +00:00
mycroft 72805df917 Various changes from John Kohl and me:
Map kernel stacks only at unique addresses.
Use one TSS per process.
Add sysarch calls for modifying IOPL and the I/O permission bitmap.
Add a compacting GDT entry allocator, for TSS and LDT selectors.
Enable modifying %fs and %gs with PT_SETREGS.
Sanitize various bits of code.
1995-10-11 04:19:29 +00:00
mycroft 25f53a986f Add USERMODE() and KERNELMODE() macros, and use them. 1995-10-10 04:45:03 +00:00
cgd c83f9c5568 remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
1995-06-28 02:55:18 +00:00
cgd 8703076975 define BROKEN_SWAP and/or cpu_swapout as appropriate. 1995-05-05 03:41:51 +00:00
christos de42a28a1b - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
1995-04-22 20:24:40 +00:00
mycroft b4813fa24a Alias delay() to DELAY() for mi code. 1995-04-21 21:56:01 +00:00
jtc 71ab4ed9dc KERNEL -> _KERNEL 1995-03-28 18:13:48 +00:00
cgd 022ee8f7fe new RCS ID format. 1994-10-27 04:14:23 +00:00
mycroft 470742fbc0 profile_tick() is no longer needed. 1994-06-14 19:37:39 +00:00
mycroft 65a32ed04c Add cpu_set_init_frame(). 1994-05-27 11:22:58 +00:00
cgd d158bd71a6 add cpu_swapin 1994-05-23 03:00:56 +00:00
cgd 7e860c9159 make cpu_wait a macro, and define cpu_coredump 1994-05-19 08:09:49 +00:00
cgd 2636f2c86a cpu-dependent sysctl structs 1994-05-07 00:53:14 +00:00
mycroft 62b418de75 Correct comment. 1994-05-06 12:23:10 +00:00