Commit Graph

2938 Commits

Author SHA1 Message Date
manu c6eca571d5 irix_elf32_probe is now responsible for finding interpreter's load
address. We do that through the irix_load_addr function, which is
not IRIX specific at all. If another emulation needs it, it can
easily move to compat_util.c

With this change, IRIX dynamic binaries are able to link and run again
(top down UVM broke them a few weeks ago)
2003-08-06 01:04:44 +00:00
christos baccb9bad5 Another chicken sacrifice to the gcc3 warning gods. 2003-08-05 21:12:53 +00:00
jdolecek d6ade97eb9 use copyout() instead of subyte() 2003-08-02 20:23:48 +00:00
jdolecek e0fe42681d use copyin()/copyout() instead of fubyte()/subyte()
also nuke uvm_useracc() check, copyin()/copyout() do this atomically

XXX only compile-tested
2003-08-02 19:51:23 +00:00
jdolecek 16b74086ed replace fuword() with copyin(), and suword() with copyout() 2003-08-02 19:21:48 +00:00
mrg caa408bca7 (void_cast_for_gcc_3_3_msg_goes_here *) 2003-07-29 16:18:54 +00:00
jdolecek a2d0517af5 More complete sendmsg(2) and recvmsg(2) emulation:
* translate MSG_* flags
* rewrite CMSG level/type to appropriate NetBSD value on input, and to Linux
  value on output
* handle different CMSG_DATA alignment for some archs

This fixes SCM_RIGHTS passing. Other SCM_* types are not supported -
the set is different on NetBSD and Linux. SCM_TIMESTAMP doesn't seem
to be actually implemented in Linux 2.5.15, so it's not supported
for Linux binaries either (for now).

PR: 21577 by Todd Vierling
2003-07-27 19:30:03 +00:00
mrg 05602c761d add a cast appease gcc3.3 2003-07-27 05:04:02 +00:00
jdolecek 21f695a1ae add LINUX_SO_PEERNAME, LINUX_SO_TIMESTAMP where it has been missing
fix value for LINUX_SO_DETACH_FILTER on couple places (unused anyway)

g/c LINUX_SCM_TIMESTAMP definition for some archs, it will be defined
in generic linux_socket.h
2003-07-26 19:59:29 +00:00
christos 91e13193ee make credentials work on the i386 by passing the original msg structure.
(from Todd Vierling)
2003-07-23 19:10:29 +00:00
christos b2163312f5 fix unused variable warning 2003-07-11 18:55:14 +00:00
manu 90c0f71598 Add HW_MACHINE sysctl 2003-07-10 14:47:34 +00:00
enami 5b4483be52 Actually move the prototype of native_to_linux_sigaltstack here. 2003-07-04 03:04:11 +00:00
christos 28f544c476 Regen. 2003-07-03 21:25:07 +00:00
christos c23e21bca5 Implement linux_rt_sigreturn for real. Add a hack for more plausible siginfo.
The java segv handler still segv's again inside the signal handler, but our
sample test program now works [gets the proper ucontext].
2003-07-03 21:24:27 +00:00
christos 72af603189 make the converter of sigaltstack public. 2003-07-03 21:22:32 +00:00
manu 0229e10bf3 Added a IOFBSETCOLORCONVERTTABLE method in ioframebuffer driver.
Added sanity check for user provided offsets in messages.
2003-07-01 19:15:47 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
thorpej 9f722af1c9 Adapt to ktrace/lwp changes. 2003-06-29 16:10:48 +00:00
thorpej 38271de3f4 Regen: adapt to linux mmap2 changes. 2003-06-29 16:08:36 +00:00
thorpej 8ab744356a Adapt to linux mmap2 changes. 2003-06-29 16:07:58 +00:00
thorpej f4fff81d3a Adapt to ktrace/lwp changes. 2003-06-29 15:49:49 +00:00
simonb 2bda3187f5 Fix 'struct lwp *' lossage. 2003-06-29 15:14:11 +00:00
jdolecek dc63267c8b properly FILE_USE/FILE_UNUSE descriptor in linux_sys_fcntl()
adresses PR kern/21628 by Wolfgang Solfrank
2003-06-29 14:51:28 +00:00
martin 69cd0c4a54 struct proc * -> struct lwp * 2003-06-29 13:33:51 +00:00
darrenr 257443876f 'struct proc *' -> 'struct lwp *' as required to get GENERIC for macppc built 2003-06-29 11:02:21 +00:00
martin 2edcbf6bb2 struct proc * -> struct lwp * 2003-06-29 10:37:45 +00:00
darrenr 9dc96360bb More changes for providing lwpid for ktrace (sparc GENERIC built) 2003-06-29 09:56:27 +00:00
simonb 0a144cd97c Fix 'struct lwp *' lossage. 2003-06-29 09:42:10 +00:00
enami 618a0ff610 Redo previous; struct proc *p is necessary if NSEQUENCER is non zero. 2003-06-29 05:26:25 +00:00
dogcow f842592241 these two got missed in darrenr's proc -> lwp changes 2003-06-29 03:29:14 +00:00
bouyer 63d28e64a6 Kill unused variable. 2003-06-28 22:52:53 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
he 86cc24bba0 #ifdef _KERNEL_OPT police. 2003-06-28 08:31:16 +00:00
he 3686522ed1 Regenerate after adding include of linux_mmap.h. 2003-06-28 07:56:51 +00:00
he c7ace1c552 Need to include linux_mmap.h to get size of struct linux_sys_mmap2_args. 2003-06-28 07:55:08 +00:00
martin 9276710861 #ifdef _KERNEL_OPT police 2003-06-25 20:30:15 +00:00
augustss 6ef6cc143d Fix missing call to FILE_UNUSE. From kern/21946, from Todd Vierling. 2003-06-23 21:53:10 +00:00
christos 9d352b5c2c PR/21936: Todd Vierling: ioctl 'r' misinterpreted 2003-06-23 21:37:27 +00:00
christos 40e148ef6b PR/21948: Todd Vierling: Implement MAP_TRYFIXED for linux emulation. 2003-06-23 21:32:33 +00:00
christos c9a5d7edc1 Regen. 2003-06-23 21:26:30 +00:00
christos 35637451db PR/21937: Todd Vierling: Proper support for mmap2 2003-06-23 21:25:56 +00:00
erh 2f3650202c Add copyright+license. 2003-06-23 17:29:25 +00:00
martin 864f19482a #ifdef _KERNEL_OPT police 2003-06-23 14:59:21 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
christos 5879a5dcf6 PR/21936: Todd Vierling: compat/linux: ioctl 'r' misinterpreted 2003-06-20 03:54:35 +00:00
christos c82b786eb3 simplify bsd_sys_bind() 2003-06-05 19:42:55 +00:00
manu c5defe555a Ooops, I deleted a debug printf just before committing and one bit was
remaining. While I'm there, fix a typo in a comment.
2003-06-05 18:51:40 +00:00
manu 278cce5ba7 regen 2003-06-05 12:28:01 +00:00
manu 2c3b365958 Search alternate /emul/* path for AF_LOCAL sockets at bind() time. 2003-06-05 12:26:27 +00:00
manu 9c3b5e7aec Replace strlcpy by strncpy so that it builds again 2003-06-04 19:51:03 +00:00
manu b5c252e8af Build again with SA 2003-06-04 19:34:32 +00:00
manu 899161bdbc Added vm_copy 2003-06-03 20:09:37 +00:00
manu faba943220 Added IOHIDSystem properties (this is about keyboard mapping)
Also added a ssize arg to mach trap args so that trap handler are aware
of the sent packet size.
2003-06-03 06:48:47 +00:00
manu 1ea26aeafe + In ioframebuffer driver:
We try to map the console framebuffer through wsdisplay. It seems to work,
 but we still need to _see_ something.
XXX Framebuffer size discovery is borken.

+ In ioframebuffer and iohidsystem:
More methods and more debug for io_connect_method_*

+ A few new IOKit mach traps.
2003-05-22 22:07:36 +00:00
manu 0d9cf0359a Added io_connect_add_client 2003-05-22 18:10:19 +00:00
nakayama 10e7db6bab Avoid strict-ailas warnings in gcc 3.3;
refer to change of sys/compat/netbsd32/netbsd32_netbsd.c r1.67 to r1.69.
2003-05-17 01:35:54 +00:00
itojun 51110d0c20 use strlcpy
[compat/svr4_32 should have bound check for SVR4_32_AUX_ARGSIZ]
2003-05-16 14:36:30 +00:00
manu 1ab318ff2d We had ugly magic values in io_connect_method_scalari_scalaro and friends.
Peeking at Darwin's header files gives some ideas of what we are doing here.

We know understand most of the stuff called by XDarwin and WindowServer before
mapping the framebuffer.
2003-05-15 23:35:37 +00:00
manu da05e7b4d3 Added io_service_close and the io_connect_map_memory method for
ioframebuffer's shared meory (used to handle the cursor).

XDarwin and WindowServer now fail on framebuffer mapping.
2003-05-14 18:28:04 +00:00
manu f75cb60078 One more I/O flavor for the ioframebuffer driver. XDarwin now crashes
when it comes to map the cursor shared memory (accroding to the source,
next step will be mapping the framebuffer, we are getting closer)
2003-05-14 15:50:38 +00:00
manu 31b52bb7f2 More efforts on the XDarwin front. Introduce io_connect_method_scalari_structo
and io_connect_method_structi_structo. We don't know at all how this stuff
works, but at least we can imitate what Darwin does.
2003-05-14 14:41:04 +00:00
manu 962a6c7d59 Fix a bug in io_registry_entry_get_property: one of the field in the
return packet was wrong (port descriptor instead of VM area descriptor),
thus leading to SIGSEGV when calling IOKit's IOFBCreateSharedCursor().

Now this is fixed we can move forward again on graphic mode.
2003-05-13 20:48:16 +00:00
christos 7218f10c3c sort the ioctl's so we can see what we've implemented and what we have not. 2003-05-07 14:21:20 +00:00
manu 4c94241d26 Make io_iterator_reset working for device class itaerators 2003-04-30 18:38:19 +00:00
manu f8c2ac11e9 typo 2003-04-30 18:05:47 +00:00
manu 9a5720f8f0 Added io_iterator_reset (there is a nundocumented flag argument, no idea
of its use yet)
2003-04-30 07:32:16 +00:00
manu d46d73437c Added the map_memory method for the IOKit, plus an implementation
for the IOHIDSystem driver in Darwin. IOHIDSystem provides access
to user interface devices.

Communication between userspace and kernel is done through a shared
memory page. Our plan is to have a kernel thread waiting on wscons
events (for now it just does nothing), and have it feeding the
shared page.
2003-04-29 22:16:38 +00:00
manu 30bb8c56a7 More debug 2003-04-29 22:12:51 +00:00
manu cbfe387fcc swapped the words in lseek offset reassembly (that was was confused-endian)
Removed useless include that came from a copy/paste.
2003-04-20 14:36:05 +00:00
christos 962f5ffade try to get this to work for both endian machines. 2003-04-20 00:32:16 +00:00
manu 1368d826d9 Regen 2003-04-20 00:10:20 +00:00
manu beca0eff14 Fixed an ABI bug in lseek: NetBSD pads the syscallarg structure because of
the off_t argument, Darwin does not. In order to get the off_t  argument
going through our syscall machinery, we declare it as two long arguments,
and we reassemble it in darwin_sys_lseek.
2003-04-20 00:09:41 +00:00
manu aa5f0948ad Improved bahvior for map_fd. When Darin uses findspace = 0, this seems to
request a mapping at fixed address, overlaying previously existing mappings.

The overlay is done by unmapping (sys_munmap) before mapping at fixed
location. This makes XDarwin able to link and run.
2003-04-19 21:41:15 +00:00
dsl 01761b17f4 Remove unnecessary caddr_t casts 2003-04-16 19:20:33 +00:00
christos c56f7f428b get rid of the ASYNCMAP ioctls 2003-04-12 05:00:38 +00:00
thorpej 5051d1c544 Use PAGE_SIZE rather than NBPG. 2003-04-09 00:39:38 +00:00
oki fb4bbe16fc Regen. 2003-04-08 10:58:55 +00:00
oki 105a3bb543 Added missing syscalls from native syscalls.master. 2003-04-08 10:57:56 +00:00
manu 0479104b05 First attempt with task_suspend/task_resume, but we hit some bugs somewhere
else in our code.
2003-04-06 17:58:49 +00:00
jdolecek 1b18fee640 this info is now in doc/RESPONSIBLE 2003-04-06 10:13:07 +00:00
manu c74de80216 Implement task_info 2003-04-05 21:18:02 +00:00
manu acab734a9e Fix a few bugs and get a better notification support (A sample program
actually works)
2003-04-05 19:27:51 +00:00
he 0a34406c13 Fill the target st_qspare array with 0, the source field has been reclaimed
for other use by the UFS2 merge, and this is just a filler anyway.
2003-04-02 22:14:23 +00:00
thorpej d071d9a8d0 Use PAGE_SIZE rather than NBPG. 2003-04-01 15:02:05 +00:00
thorpej d46b766d7d Use PAGE_SIZE rather than NBPG. 2003-04-01 14:45:09 +00:00
thorpej 24ab4adb9c Use PAGE_SIZE rather than NBPG. 2003-04-01 01:53:40 +00:00
thorpej f4a068d5c2 Use PAGE_SIZE rather than NBPG. 2003-04-01 01:43:29 +00:00
manu fd94bf9486 First work on notifications. Not really working for now. 2003-03-29 11:04:08 +00:00
he 9f8115667b Adapt to changed signature for ioctl routine (caddr_t -> void*). 2003-03-27 15:54:02 +00:00
nakayama ac2c6fba75 Make it compile again; follow fo_ioctl change (hi David!). 2003-03-22 07:54:22 +00:00
dsl bd99e3429d Use 'void *' instead of 'caddr_t' in prototypes of VOP_IOCTL, VOP_FCNTL
and VOP_ADVLOCK, delete casts from callers (and some to copyin/out).
2003-03-21 23:11:19 +00:00
dsl 60418b39b7 Change 'data' argument to fo_ioctl and fo_fcntl from 'caddr_t' to 'void *'.
Avoids a lot of casting and removes the need for some line breaks.
Removed a load of (caddr_t) casts from calls to copyin/copyout as well.
(approved by christos - he has a plan to remove caddr_t...)
2003-03-21 21:13:50 +00:00
dsl 9be8ac5294 Alternative pid/proc allocater, removes all searches associated with pid
lookup and allocation, and any dependency on NPROC or MAXUSERS.
NO_PID changed to -1 (and renamed NO_PGID) to remove artificial limit
on PID_MAX.
As discussed on tech-kern.
2003-03-19 11:36:32 +00:00
manu 523dbf2146 Quick and dirty version of io_registry_entry_get_properties. 2003-03-09 18:33:28 +00:00
he 385f6e3afe Remove to local declarations of "p" which are no more in use, to make
this compile again.
2003-03-08 01:20:21 +00:00
manu a6757a0de1 Less accurate vm_region, but it sticks better to Darwin results. 2003-03-05 22:39:48 +00:00
dsl 4c320740d2 Use do_setres{u,g}id for osf1_sys_set{u,g}id 2003-03-05 18:47:39 +00:00
dsl dfdb668a2e Reimplement linux_sys_setresgid() in terms of do_setresgid() 2003-03-05 18:46:11 +00:00
dsl eabc565aaf Use do_setresuid() to implement linux_sys_setresuid() 2003-03-05 18:44:46 +00:00
manu 03dfd69a01 Added vm_region and vm_msync traps 2003-03-03 22:07:39 +00:00
thorpej 5afa6838bf Do the syscall_plain/syscall_fancy dance on ARM. Shaves a fair number
of cycles off the syscall overhead.

Since all COMPAT_LINUX platforms now support __HAVE_SYSCALL_INTERN,
garbage-collect the LINUX_SYSCALL_FUNCTION stuff.
2003-03-01 04:36:38 +00:00
manu edcf894563 Notification request packets format, nothing implemented yet. 2003-02-28 09:30:23 +00:00
cgd cd122e4a2d in irix_syssgi_mapelf: use vn_marktext where necessary, and make sure
a file isn't accidentally left 'USE'd if an error occurs.  reviewed
by simonb.
2003-02-28 02:12:55 +00:00
yamt da8d9f98f5 make compat_linux struct file interlock friendly. 2003-02-27 16:04:15 +00:00
enami 37d7d10857 Remember the allocated ptimer object so that it won't leak. 2003-02-23 23:36:35 +00:00
pk 2931081a79 Make updating a file's reference and use count MP-safe. 2003-02-23 14:37:32 +00:00
manu c3be74fe41 Introduced IOKit driver methods. Moved back into Mach some IOKit driver
support that was in Darwin code. I get an empty darwin_iokit.c, which is
getting a good candidate for cvs delete.
2003-02-20 22:39:42 +00:00
jdolecek 25d6f89a59 update emul alarm syscalls to recent timer changes
problem encountered by Luke Mewburn for linux emul, problem spot
found by Enami Tsugutomo
2003-02-19 11:23:53 +00:00
jdolecek 853290d652 remove local idea of ELF_AUX_ARGSIZ - since this emul uses elf32_copyargs(),
it shouldn't override the size
2003-02-19 09:45:48 +00:00
manu 749de24f94 - Make sure darwin_iokit_ioframebuffer is invoked
- fix a mistake in mach_io_registry_entry_get_property message format
2003-02-16 18:33:35 +00:00
manu ca120fe1a2 Match IOHIDSystem and IOFramebuffer request in the IOKit and handle them in
Darwin specific files. The handler does nothing yet.

This needs some improvement. Darwin attaches an IOHIDSystem device to
each human-interface device in the tree: mouse, keyboard, and a few others.
For now we only emulate one IOHIDSystem device.
2003-02-16 15:02:05 +00:00
dsl 71d53fb2ed Use find_stopped_child() and proc_free() in compat wait() code to
avoid code duplication.
(approved by christos)
2003-02-14 10:19:14 +00:00
christos e163414ca5 include more opt_ files for nfs. 2003-02-10 17:33:13 +00:00
christos 1bc826ce5e getfh is needed for NFS server. 2003-02-10 17:30:08 +00:00
manu 80a30f1a31 A first attempt at providing access to our device tree through the IOKit.
Darwin's ioreg is able to display the tree.
2003-02-09 22:13:46 +00:00
manu 44af8c7eb4 More IOKit shell. This makes ioreg looping on device discovery: foobar
has a child called foobar, and so on.
2003-02-07 20:40:37 +00:00
manu d0139ca922 More iokit shell: it does nothing, but WindowServer get a bit more far
away and ends with a SIGSEGV.
2003-02-07 16:56:19 +00:00
manu 2e73bb80fe More IOKit basics. Also introduced a mach_port flag to get a precise idea
of what port is sending a message to the kernel.
2003-02-05 23:58:09 +00:00
manu 357afc4e2f Some bits of the first iokit call 2003-02-04 22:47:41 +00:00
manu a643d6a63e Fixed typo 2003-02-03 20:46:55 +00:00
manu 2cd19ab0b2 - WindowServer wants io_master_port? Give it a port!
- introduce mach_port_destroy (badly emulated for now)
- on fork/exec, don't set l_private, as the process might be not mature
enough to survive a proc_representative_lwp call (-> kernel panic)

Once we give WindowServer the io_master_port, it sends a message to it:

   305 WindowServer MMSG  id 2804 [0x1310009 -> 0x131000e] -12016 bytes, flags 0
x1513
   0x0000  0x00001513 0xffffd110 0x0131000e 0x01310009   .........1...1..
   0x0010  0xffffcfd0 0x00000af4 0x00000000 0x00000000   ................
   0x0020  0xffffcf60 0x00000052 0x3c646963 0x74204944   ...`...R<dict ID
   0x0030  0x3d223022 0x3e3c6b65 0x793e494f 0x50726f76   ="0"><key>IOProv
   0x0040  0x69646572 0x436c6173 0x733c2f6b 0x65793e3c   iderClass</key><
   0x0050  0x73747269 0x6e672049 0x443d2231 0x223e494f   string ID="1">IO
   0x0060  0x48494453 0x79737465 0x6d3c2f73 0x7472696e   HIDSystem</strin
   0x0070  0x673e3c2f 0x64696374 0x3e0047cc              g></dict>.G.

Did you ever dreamt about system call arguments in XML?
2003-02-02 19:06:31 +00:00
manu 34a458238c For cproc_t, use a per thread value instead of a per process value. ifdef
out l_emuldata in struct lwp until we actually use it.
2003-01-30 19:14:18 +00:00
atatat bede65472d Cull unused variables. Sigh.
PS - Cross compilers are cool.
2003-01-29 07:00:35 +00:00
manu 26723dc292 lwpified sproc emulation so that it builds and works again. COMPAT_IRIX
now has the level of functionnality it had before SA merge
2003-01-28 23:47:42 +00:00
atatat 59b8237f5e No need to pick a "default address" for mmap in compat code, since we
merely call sys_mmap() at the end anyway, and that will pick the
address for us, if it's needed.

Likewise for checking if /dev/zero is being mapped.
2003-01-28 21:57:42 +00:00
manu 7e15e89c0a Fixed dumb bug 2003-01-26 19:32:04 +00:00
manu ce8bd172b2 For thread creation, make the newly created thread runnable. Mach threads
are now functionnal again.
2003-01-26 19:02:14 +00:00
manu 55215e5266 Remove right duplication on thread creation, which became useless now we
are using lwp.
Enable kill -9 to kill parent thread waiting for its child.
Use upcallret instead of child_return for the newly created lwp.
Add debug messages for thread creation.

Thread creation are still broken...
2003-01-26 12:39:32 +00:00
manu 82a9c6faf0 Use per process emuldata for the thread id for now, but this will change
shortly. This makes hello world working again.
2003-01-24 22:35:43 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
manu cb771e3c64 Make the beast build again (but it is still probably broken) 2003-01-24 21:37:01 +00:00
rafal 4490fd7293 Last bit of LWP'ification of compat_irix; this is probably wrong, but at
least it compiles and manu said he'd fix it up and test the whole kit when
he had a chance.
2003-01-22 21:04:50 +00:00
christos 2bb5209b1b lwp'ify 2003-01-22 17:48:02 +00:00
christos ed339f5241 regen. 2003-01-22 17:47:47 +00:00
christos bcc3424bc3 regen 2003-01-22 17:47:35 +00:00
christos 498aa03f2a lwp conversion 2003-01-22 17:47:03 +00:00
rafal 5234d1eb92 Mechanical LWP'ification of IRIX compat code; untested as of right now. 2003-01-22 12:58:22 +00:00
matt b03d17694a Do a preliminary switchover of the mach code to lwp's. It compiles now
but probably doesn't work.   That's for someone who understand this code
better.
2003-01-21 04:06:06 +00:00
matt de92ce633f Regen. 2003-01-21 04:02:37 +00:00
matt d8ad92c6b6 Add <sys/sa.h> 2003-01-21 04:02:10 +00:00
matt 312dfd8487 Adapt to the LWP world. 2003-01-21 04:01:09 +00:00
matt e093b867e9 Regen. 2003-01-21 04:00:02 +00:00
matt 6d793da904 Add <sys/sa.h> 2003-01-21 03:59:27 +00:00
jdolecek d4ad86a080 finish LWPify 2003-01-21 03:16:06 +00:00
martin 5adc155ebd Fix lwp_wait syscallargs. This closes PR 19941. 2003-01-20 08:27:40 +00:00
simonb b4cf696706 Don't need a semi-colon after the closing brace of a function. 2003-01-20 07:18:59 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
simonb 2eaedc2774 Remove variables that are only assigned too but not referenced. 2003-01-20 01:35:11 +00:00
thorpej 20ba6d6368 Regen to get correct RCS ID. 2003-01-19 16:49:12 +00:00