Commit Graph

3170 Commits

Author SHA1 Message Date
manu d4d3cc307c commpage function changes:
Copy all the commpages instead of one
Add the missing bcopy function
Wrong function name: pthread_getspecific instead of pthread_specific
2004-07-11 19:38:14 +00:00
christos b970e18139 Regen 2004-07-07 22:04:27 +00:00
christos 63c19634d0 no #ifdef __powerpc__ here. 2004-07-07 22:03:38 +00:00
manu 67cf1bc043 MacOS X.3 introduces a new sigreturn for PowerPC, with a usercontext
versionning argument. For now we only implement the X.2 flavor.
2004-07-04 21:03:55 +00:00
manu aab7e2ab6f Useful debug since ktrace doesn't show sysctl arg array. 2004-07-04 20:30:14 +00:00
christos 439d1da971 #ifdef the altivec option, because only powerpc has it. To be fixed in
a better way later.
2004-07-04 15:27:26 +00:00
manu 7fef082024 Move all the MD bits of commpage to a new file.
Map the comm page as RW in kernel (we want to modify it but not to execute it),
and RX in userland (no need to modify it but we want to execute it
2004-07-03 22:17:18 +00:00
manu 318748a9d0 Wrong argument to memset for bzero in commpage. 2004-07-03 17:29:17 +00:00
manu 5d33c4b91c 2^53 does not compute 2 power 53... 2004-07-03 16:47:13 +00:00
manu 4d933c5be0 Mark the thread id as clean in cthread_set_self 2004-07-03 09:44:04 +00:00
manu 26200ee754 In MacOS X.3, the kernel maps tw opages of memory in every user process.
This areas is called the comm pages. It is used to provide fast access to
several data and functions.

The comm pages are mapped starting at 0xffff800 (address chosed so that
absolute branch can be used, so it can be accessed even when dynamic linking
is not ready). NetBSD has the user stack here, so we need to provide a
Darwin-specific stack setup routine which sets the top of the stack at
0xbfff0000.

This implementation is not complete but it does enough to get MacOS X.3
starting again (static binaries run, dynamic binaries still have an issue).
in the comm pages functions, we only implement bcopy, pthread_self and
memcpy.

TODO:
- clean up the powerpc specific code from MD parts
- for now we map only one page to avoid a crash, we want two pages.
- write all the comm functions.
2004-07-03 00:14:30 +00:00
drochner 6f8b4c1216 There is no point in mapping a NetBSD signal trampoline
(which doesn't exist unless COMPAT_16 anyway)
into a Darwin emulation process' address space.
2004-06-24 17:02:06 +00:00
manu 31f25e173c Fix a reversed errno issue for Linux binaries on mips. While we are there,
fix broken includes for alpha and m68k.
2004-06-19 22:59:40 +00:00
manu b2563527a8 Build COMPAT_LINUX again on mips after the siginfo change. 2004-06-19 18:45:30 +00:00
manu 0d510f3e7e include <sys/resourcevar.h>. It is not required for building -current,
but it is for -netbsd-2-0. Next step is to pull up the change...
2004-06-18 17:06:15 +00:00
cube 4277a3964f Regen. 2004-06-17 18:30:54 +00:00
cube 4b2667d3ec o Add support for the statvfs family of syscalls (statvfs1, fstatvfs1,
fhstatvfs1 and getvfsstat)
o Move the statfs family out of netbsd32_fs.c and netbsd32_netbsd.c to
  netbsd_compat_20.c, compiled with COMPAT_20

Reviewed by christos@.
2004-06-17 18:29:40 +00:00
manu 6b1a152604 COMPAT_LINUX/powerpc used the native stack setup routine, but now the
native version does non executable mappings on the stack. This is a
showstopper for Linux binaries.

To fix that we supply a copy f the native stack setup function for Linux
binaries, with the executable bit set.
2004-06-16 00:03:25 +00:00
yamt 6c4915e34d linux_sys_ioctl: map EPASSTHROUGH to EINVAL as sys_ioctl does.
otherwise, linux_syscall() returns garbage, at least on i386.
(it returns native_to_linux_errno[EPASSTHROUGH] where EPASSTHROUGH == -4.)

i choose EINVAL rather than ENOTTY, because linux's pipe returns it
and i think that it's a common case.
2004-06-03 01:53:28 +00:00
pk c245462cb8 hpux_ioctl(): acquire a reference to the file. 2004-06-01 11:05:40 +00:00
pk f0f0f16529 svr4_sys_ioctl(): acquire a reference to the file. 2004-06-01 10:38:39 +00:00
pk c6c77837c9 sunos_ioctl(): acquire a reference to the file.
This also fixes a locking botch reported in PR#25738.
2004-06-01 10:27:39 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 190adb15c3 Sysctl descriptions under emul subtree. 2004-05-25 04:29:08 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
christos 85699649e2 grr, forgot to take out the & 2004-05-22 20:53:26 +00:00
christos 9a0b176050 allocate memory for statvfs instead of using the stack. 2004-05-22 20:46:53 +00:00
atatat 10a7ba9ef6 Tweak sysctl setup functions (the macros, actually) for use in lkms,
and tweak lkminit_*.c (where applicable) to call them, and to call
sysctl_teardown() when being unloaded.

This consists of (1) making setup functions not be static when being
compiled as lkms (change to sys/sysctl.h), (2) making prototypes
visible for the various setup functions in header files (changes to
various header files), and (3) making simple "load" and "unload"
functions in the actual lkminit stuff.

linux_sysctl.c also needs its root exposed (ie, made not static) for
this (when built as an lkm).
2004-05-20 06:34:24 +00:00
drochner 644e697b54 regen 2004-05-11 10:55:29 +00:00
drochner c736283f11 FreeBSD emulation should not depend on NetBSD binary compatibility
options. Include compat_20_sys_*statfs* unconditionally.
2004-05-11 10:54:51 +00:00
jonathan d2dde9d018 Regen src/sys/compat/freebsd_sys{call.h,callargs.h,calls.c,ent.c} from
syscalls.master rev 1.45, with COMPAT_2.0 fix.
2004-05-10 20:47:14 +00:00
christos cec7684b79 Add opt_compat_netbsd.h because we need it for COMPAT_20; pointed out
by Jonathan Stone.
2004-05-10 20:27:42 +00:00
kent e3f4d77dda regenerate for fsync_range, uuidgen, getvfsstat, statvfs1, fstatvfs1, and fhstatvfs1 2004-05-08 14:33:12 +00:00
kent af38d21dbd add fsync_range, uuidgen, getvfsstat, statvfs1, fstatvfs1, and fhstatvfs1. 2004-05-08 14:31:59 +00:00
pk 4a04452106 Use crdup(), instead of crget()+memcpy(). 2004-05-02 12:32:22 +00:00
fair 5b3531cc87 Line 175 VFS_STAVTFS -> STATVFS (tyop) 2004-04-27 21:37:49 +00:00
atatat e5004170aa Be consistent about using sysc_init_field() 2004-04-27 03:49:03 +00:00
christos f987d253b9 PR/25335: Erik E. Fair: statvfs lossage in sys/lkm/compat/osf1 2004-04-26 20:33:50 +00:00
matt b1fee09f27 Constify sreq2breq 2004-04-25 06:25:52 +00:00
matt 22120ad628 Constify the speedtab arrays 2004-04-25 06:23:40 +00:00
matt c768d54573 Constify an array. 2004-04-25 06:04:54 +00:00
matt 48011c94e7 Constify a few read-only arrays/variables. 2004-04-25 06:02:20 +00:00
atatat 3f800573aa Be consistent about using sysc_init_field() 2004-04-25 05:54:38 +00:00
christos dede52abd3 PR/25288: Erik E. Fair: convert this file to statvfs 2004-04-23 12:02:39 +00:00
hannken fcd7f3df90 Fix statfs->statvfs fallout. 2004-04-22 14:32:09 +00:00
christos 924e775ac7 fix statvfs->statvfs1 fallout 2004-04-22 14:06:31 +00:00
christos e6f05cd289 Add the missing 'v' to fhstatvfs1 2004-04-22 12:04:03 +00:00
hannken 754675a0e1 Make it compile again after statvfs import. 2004-04-22 10:18:03 +00:00
matt 633d902c65 Regen for statvfs changes. 2004-04-22 05:44:30 +00:00
christos 22df5bb240 try to make this compile. XXX: this will not work yet (hi simon) 2004-04-21 11:50:26 +00:00