Commit graph

756 commits

Author SHA1 Message Date
Marcel Moolenaar b019ad1bc0 In cb_dumphdr() we were calling buf_write() with di->priv as the
pointer to a dumperinfo instead of di. A brainfart, surely. This
bug went unnoticed for all this time because the pointer is only
used by buf_write() when it can write a completely filled buffer
to the dump device. This depends on the number of memory chunks
that needs to be dumped. This has apparently been low enough that
it has never happened up until this point.
2002-10-20 23:39:43 +00:00
Marcel Moolenaar bfc937c758 Remove the special casing for IP addresses that are within the IVT
or the do_syscall() function. We have unwind directives to stop the
unwinder.
2002-10-20 06:03:05 +00:00
Marcel Moolenaar 341572f4bd Define IVT_ENTRY and IVT_END as special versions of ENTRY and END
for defining vectors. As a result, each vector will be a global
function with unwind directives to notify the unwinder that we're
in an interrupt handler. In the debugger this will show up something
like:

Debugger(0xe000000000a211d8, 0xe000000000748960) at Debugger+0x31
panic(0xe000000000a36858, 0xe0000000021d32d0, 0xe000000000ae42e8, ...
trap(0x14, 0x100000, 0xe0000000021d32d0, 0x0, 0xa0000000002095f0, ...
ivt_Data_TLB(0x14, 0x100000, 0xe0000000021d32d0) at ivt_Data_TLB+0x1f0
2002-10-20 06:00:09 +00:00
Peter Wemm 8556393bb2 Stake a claim on 418 (__xstat), 419 (__xfstat), 420 (__xlstat) 2002-10-19 22:25:31 +00:00
Peter Wemm c8447553b5 Grab 416/417 real estate before I get burned while testing again.
This is for the not-quite-ready signal/fpu abi stuff.  It may not see
the light of day, but I'm certainly not going to be able to validate it
when getting shot in the foot due to syscall number conflicts.
2002-10-19 22:09:23 +00:00
Robert Watson bc5245d94c Add a placeholder for the execve_mac() system call, similar to SELinux's
execve_secure() system call, which permits a process to pass in a label
for a label change during exec.  This permits SELinux to change the
label for the resulting exec without a race following a manual label
change on the process.  Because this interface uses our general purpose
MAC label abstraction, we call it execve_mac(), and wrap our port of
SELinux's execve_secure() around it with appropriate sid mappings.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-19 21:06:57 +00:00
Marcel Moolenaar c8a4afbc11 Update the unwind information when modules are loaded and unloaded
by using the linker hooks. Since these hooks are called for the
kernel as well, we don't need to deal with that with a special
SYSINIT. The initialization implicitly performed on the first
update of the unwind information is made explicit with a SYSINIT.
We now don't need the _ia64_unwind_{start|end} symbols.
2002-10-19 19:30:38 +00:00
Marcel Moolenaar 1aeb23cdfa Add two hooks to signal module load and module unload to MD code.
The primary reason for this is to allow MD code to process machine
specific attributes, segments or sections in the ELF file and
update machine specific state accordingly. An immediate use of this
is in the ia64 port where unwind information is updated to allow
debugging and tracing in/across modules. Note that this commit
does not add the functionality to the ia64 port. See revision 1.9
of ia64/ia64/elf_machdep.c.

Validated on: alpha, i386, ia64
2002-10-19 19:16:03 +00:00
Robert Watson c7063e5913 Permits UFS ACLs to be used with the GENERIC kernel. Due to recent
ACL configuration changes, this shouldn't result in different code paths
for file systems not explicitly configured for ACLs by the system
administrator.  For UFS1, administrators must still recompile their
kernel to add support for extended attributes; for UFS2, it's sufficient
to enable ACLs using tunefs or at mount-time (tunefs preferred for
reliability reasons).  UFS2, for a variety of reasons, including
performance and reliability, is the preferred file system for use with
ACLs.

Approved by:	re
2002-10-19 16:54:15 +00:00
Marcel Moolenaar db55d99d36 Make this compile when DDB is not defined by conditionally compiling
all references to ksym_start and ksym_end.
2002-10-19 04:14:08 +00:00
Marcel Moolenaar 47f750125b Fix kernel module loading on ia64. Cross-module function calls
were improperly relocated due to faulty logic in lookup_fdesc()
in elf_machdep.c. The symbol index (symidx) was bogusly used for
load modules other than the one the relocation applied to. This
resulted in bogus bindings and consequently runtime failures.

The fix is to use the symbol index only for the module being
relocated and to use the symbol name for look-ups in the
modules in the dependent list. As such, we need a function to
return the symbol name given the linker file and symbol index.
2002-10-15 05:40:07 +00:00
Peter Wemm af3f249f3a The a.out md_coredump stuff isn't referenced anywhere anymore, and
hasn't been filled in for ages..  Nuked.
2002-10-15 00:02:50 +00:00
Marcel Moolenaar df8b64f634 Allow kernel dumps to be aborted with ctrl-C. 2002-10-14 05:38:22 +00:00
Mike Barcroft 4275e0d98d Remove the P1003_1B kernel option; it is no longer used. 2002-10-13 16:29:17 +00:00
Mike Barcroft 795b630655 struct ia64_fpreg needs to be available outside of the kernel for
struct sigcontext.

Pointy hat to: mike
2002-10-13 15:30:17 +00:00
Mike Barcroft 7a77412855 Add standards visibility conditionals. Change any uses of sigset_t to
struct __sigset to avoid depending on objects from <sys/signal.h>.
2002-10-13 00:31:46 +00:00
Marcel Moolenaar 163afbe0d5 o Fix typo in previous commit: s/sc-nsect/sc->nsect/
o  Fix printf format error for %d format with long argument.
2002-10-12 23:00:40 +00:00
Marcel Moolenaar 3508148f6e Plug two holes where we returned to userland without restoring
the predicate registers. Even though the ITLB and DTLB interrupts
happen often enough, this bug didn't do much harm. The reason
is that the interrupt handlers only modify p1 and since this is
a preserved (callee-saved) register it is hardly used in code
generated by the compiler. Compilers use scratch registers by
default. Changing the interrupt handlers to use p6 (ie a scratch
register) proved that the bug was in fact fatal.
2002-10-12 22:42:48 +00:00
Marcel Moolenaar 02cda72148 Polish previous commit:
o  Replace KSTACK_PAGES with pages on panic() in pmap_new_thread(),
o  Fix style bugs in adjacent code,
o  Use NULL instead of 0 for pointers,
o  Save the virtual kstack address if we create an alternate
   kstack because 1) we can derive the physical (RR7) address
   from it and 2) we need the virtual address for contigfree()
   in pmap_dispose_thread(). Thus td_altkstack saves
   td_md.md_kstackvirt.
2002-10-12 21:04:01 +00:00
Marcel Moolenaar 8d7d4e5d71 MFp4: Include machine/vmparam.h to pull in definition of IA64_RR_BASE.
Obtained from: peter
2002-10-12 20:54:05 +00:00
Marcel Moolenaar 526a05f186 Remove the dependency on ia64_cpu.h by not defining pmap_kextract()
as a trivial function that only calls ia64_tpa() and hence requires
the prototype of ia64_tpa(), but by defining pmap_kextract as
ia64_tpa. This solves the inclusion ordering issue in ddb/db_watch.c
2002-10-12 20:35:56 +00:00
Peter Wemm 4d5266715e cut/paste the pmap_new_altkstack stuff from the other platforms.
It's no different here.  Update the rest of the kstack API's for scottl's
changes.
2002-10-11 22:29:22 +00:00
Peter Wemm 0250db7caa Call uma_zalloc on pvzone with M_NOWAIT, just like i386 and alpha.
Otherwise we get hundreds of 'could sleep' during boot.
2002-10-11 21:41:53 +00:00
Mike Barcroft 2b7f24d210 Change iov_base's type from char *' to the standard void *'. All
uses of iov_base which assume its type is `char *' (in order to do
pointer arithmetic) have been updated to cast iov_base to `char *'.
2002-10-11 14:58:34 +00:00
Peter Wemm d6b8445ebd re-regen. Sigh. 2002-10-09 22:40:41 +00:00
Peter Wemm d4f4eb09d9 Sigh. Fix fat-fingering of diff. I knew this was going to happen. 2002-10-09 22:40:02 +00:00
Peter Wemm 9105d26b73 regenerate. sendfile stuff and other recently picked up stubs. 2002-10-09 22:28:48 +00:00
Peter Wemm 459e3a7a37 Try and deal with the #ifdef COMPAT_FREEBSD4 sendfile stuff. This would
have been a lot easier if do_sendfile() was usable externally.
2002-10-09 22:27:24 +00:00
Peter Wemm 4f4c431d9b Try and patch up some tab-to-space spammage. 2002-10-09 22:14:35 +00:00
Peter Wemm 8e223883f0 Add placeholder stubs for nsendfile, mac_syscall, ksem_close, ksem_post,
ksem_wait, ksem_trywait, ksem_init, ksem_open, ksem_unlink, ksem_getvalue,
ksem_destroy, __mac_get_pid, __mac_get_link, __mac_set_link,
extattr_set_link, extattr_get_link, extattr_delete_link.
2002-10-09 22:10:23 +00:00
Mike Barcroft ddb056b7d4 Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
Mike Barcroft 0b058e3cbd o Add conditionals to allow va_list to be defined in other headers.
o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes.
o Restrict the definition of va_copy() to C99 environments.
2002-10-06 22:01:07 +00:00
David E. O'Brien 39b9b6a43f It appears CPU_MAXID should be 1 more than the number of CPU_* defines. 2002-10-06 05:25:10 +00:00
Poul-Henning Kamp 3bd6561289 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
Mike Barcroft e61d3b10d7 Fix namespace issues by using visibility conditionals from
<sys/cdefs.h>.
2002-10-05 05:47:56 +00:00
Mike Barcroft 085f8416a2 style(9) <machine/setjmp.h> headers so they look mostly the same. 2002-10-04 22:10:06 +00:00
Sam Leffler 14c17bd293 New bus_dma interfaces for use by crypto device drivers:
o bus_dmamap_load_mbuf
o bus_dmamap_load_uio

Test on i386.  Known to compile on alpha and sparc64, but not tested.
Otherwise untried.
2002-10-04 20:40:39 +00:00
Peter Wemm debff18680 Gah, spell extern correctly. Do not trust cut/paste via old mozilla
builds.
2002-10-04 01:57:46 +00:00
Peter Wemm ae8ef28761 List the IO SAPIC delivery mode definitions. 2002-10-04 01:33:30 +00:00
Peter Wemm 74cf93d79d Declare itc_frequency and itm_reload. 2002-10-04 01:23:58 +00:00
Peter Wemm 120e7b6b43 Do a bit of rude hackery to get clock interrupts on all CPUs. This
is partly based on the Alpha system which duplicates the clock to
each cpu, instead of doing a clock roundrobin like on i386.  This means
we get hz * ncpu clocks per second and so we have to seperate clock
sampling from actual 'do the work' clock processing.  The BSP runs the
complete processing, the rest just sample state etc.

Using the on-cpu interval timer is not ideal as it will drift.  There
is more to be done here, we should use an external clock source.
2002-10-04 01:00:35 +00:00
Peter Wemm da2893e7ed Update stubs for post-kseIII. 2002-10-04 00:19:58 +00:00
Peter Wemm 1678d0990b Update for post-kseIII 2002-10-04 00:18:21 +00:00
Archie Cobbs 36a8dac10d Let kse_wakeup() take a KSE mailbox pointer argument.
Reviewed by:	julian
2002-10-02 16:48:16 +00:00
Poul-Henning Kamp fcd054483a Fix the same misinitialization of pmap_prefault_pageorder as on i386.
Suggeste by:	jake
2002-10-01 20:56:29 +00:00
Archie Cobbs 89def71cbd Make the following name changes to KSE related functions, etc., to better
represent their purpose and minimize namespace conflicts:

	kse_fn_t		-> kse_func_t
	struct thread_mailbox	-> struct kse_thr_mailbox
	thread_interrupt()	-> kse_thr_interrupt()
	kse_yield()		-> kse_release()
	kse_new()		-> kse_create()

Add missing declaration of kse_thr_interrupt() to <sys/kse.h>.
Regenerate the various generated syscall files. Minor style fixes.

Reviewed by:	julian
2002-09-25 18:10:42 +00:00
Alfred Perlstein 4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
Peter Wemm c692fbe091 At great personal risk, add a __packed and __aligned(x) define that
expand to __attribute__((packed)) and __attribute__((aligned(x)))
respectively.  Replace the handful of gcc-ism's that use
__attribute__((aligned(16))) etc around the kernel with __aligned(16).

There are over 400 __attribute__((packed)) to deal with, that can come
later.  I just want to use __packed in new code rather than add more
gcc-ism's.
2002-09-23 05:55:10 +00:00
Mike Barcroft c0d4804d67 Be careful not to define GCC-specific optimizations in the non-GCC
case.
2002-09-23 04:32:17 +00:00
Poul-Henning Kamp 7812d86f03 (This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer).  This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by:   DARPA & NAI Labs.
2002-09-20 19:36:05 +00:00