summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-05-25include: fix the embedded type definitions in memory_object.defsJustus Winter
In order to use MIG translation functions to lookup memory objects, preprocessor macros have been introduced into the definition of memory_object_t in 50cc5152. The procedure definitions contain inlined type definitions in order to change the type of the argument in question (i.e. to make it polymorphic). The inline definitions however lack the destructor function, leading to reference leaks when a reference is acquired in the intran function. * include/mach/memory_object.defs: Add the destructor functions to the inlined type definitions.
2014-05-03ddb: add "halt" commandJustus Winter
* ddb/db_command.c (db_command_table): Add "halt" command. * i386/i386/db_interface.h (db_halt_cpu): New declaration. * i386/i386at/model_dep.c (db_halt_cpu): New function.
2014-04-30vm: make struct vm_map fit into a cache lineJustus Winter
Currently, the size of struct vm_map is 68 bytes. By using a bit field for the boolean flags, it can be made fit into a cache line. * vm/vm_map.h (struct vm_map): Use a bit field for the boolean flags wait_for_space and wiring_required.
2014-04-30i386: fix MACHINE_SERVER_HEADERJustus Winter
Commit b6dab094 introduced a way to include the MIG-generated server files for the machine specific interface in ipc_kobject.c. This broke out-of-tree builds. Here, 'machine' is a symlink to '../i386/i386', it points into the source tree. The MIG-generated files however are put in the build tree in i386/i386. * i386/i386/machine_routines.h (MACHINE_SERVER_HEADER): Fix path.
2014-04-30kern: include the MIG-generated server headers for MACHINE_SERVERJustus Winter
GNU MIG recently gained support for emitting x_server_routine declarations in the generated server header file. Using this declaration, the x_server_routine functions can be inlined into the ipc_kobject_server function. * kern/ipc_kobject.c: Include the MIG-generated server headers for the machine-dependent interfaces. (ipc_kobject_server): Drop the simple declaration of MACHINE_SERVER_ROUTINE. * i386/i386/machine_routines.h (MACHINE_SERVER_HEADER): New definition.
2014-04-30include: do not guard the host_slab_info RPC with MACH_VM_DEBUGJustus Winter
Previously, the definition of the host_slab_info RPC was guarded with MACH_VM_DEBUG, even though it is not at all concerned with the VM subsystem. Furthermore, there was no "skip" directive for host_slab_info. The function host_slab_info is guarded with MACH_DEBUG. The server for the RPCs in mach_debug.defs is only used if MACH_DEBUG is defined. There is no need to guard host_slab_info. * include/mach_debug/mach_debug.defs (host_slab_info): Unconditionally include the RPC.
2014-04-30Install the mach_debug header filesJustus Winter
The task_set_name RPC introduced in 877a319c changed include/mach/gnumach.defs to include mach_debug/mach_debug_types.defs. Previously though, the debug headers were not installed. * Makefrag.am: Install the mach_debug header files.
2014-04-30doc: fix the number of prioritiesJustus Winter
The number of priorities has been changed from 32 to 50 in 6a234201081156e6d5742e7eeabb68418b518fad. * doc/mach.texi: Update accordingly.
2014-04-25Make sure mig is availableSamuel Thibault
* configure.ac (MIG): Error out if MiG was not found.
2014-04-13kern: set the name of tasks created during the bootstrapJustus Winter
* kern/bootstrap.c (boot_script_task_create): Set the name of newly created tasks.
2014-04-10include: fix the definition of device_openJustus Winter
Previously, every userspace server implementing the device protocol filtered the device definitions to replace the device_t type with mach_port_send_t to make the device argument of device_open polymorphic. Rather than doing that, which makes it impossible to use translation functions, fix the definition of device_open. * include/device/device.defs (device_open): Redefine the device argument to make it polymorphic unless a outran function is specified.
2014-04-08include: make the device_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the DEVICE_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/device/device_types.defs: Honor DEVICE_IMPORTS. (device_t): Make the translation mutable using preprocessor macros.
2014-04-05include: make the notify_port_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the NOTIFY_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/mach/notify.defs: Honor NOTIFY_IMPORTS. (notify_port_t): Make the translation mutable using preprocessor macros.
2014-04-04Convert from K&R to ANSIMarin Ramesa
Convert from K&R style function definitions to ANSI style function definitions. * ddb/db_access.c: Convert function prototypes from K&R to ANSI. * ddb/db_aout.c: Likewise. * ddb/db_break.c: Likewise. * ddb/db_command.c: Likewise. * ddb/db_cond.c: Likewise. * ddb/db_examine.c: Likewise. * ddb/db_expr.c: Likewise. * ddb/db_ext_symtab.c: Likewise. * ddb/db_input.c: Likewise. * ddb/db_lex.c: Likewise. * ddb/db_macro.c: Likewise. * ddb/db_mp.c: Likewise. * ddb/db_output.c: Likewise. * ddb/db_print.c: Likewise. * ddb/db_run.c: Likewise. * ddb/db_sym.c: Likewise. * ddb/db_task_thread.c: Likewise. * ddb/db_trap.c: Likewise. * ddb/db_variables.c: Likewise. * ddb/db_watch.c: Likewise. * device/blkio.c: Likewise. * device/chario.c: Likewise. * device/dev_lookup.c: Likewise. * device/dev_name.c: Likewise. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/net_io.c: Likewise. * device/subrs.c: Likewise. * i386/i386/db_interface.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_map.c: Likewise. * i386/i386/loose_ends.c: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/phys.c: Likewise. * i386/i386/trap.c: Likewise. * i386/i386/user_ldt.c: Likewise. * i386/i386at/com.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/kd_event.c: Likewise. * i386/i386at/kd_mouse.c: Likewise. * i386/i386at/kd_queue.c: Likewise. * i386/i386at/lpr.c: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/i386at/rtc.c: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/read_fault.c: Likewise. * ipc/ipc_entry.c: Likewise. * ipc/ipc_hash.c: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_mqueue.c: Likewise. * ipc/ipc_notify.c: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_right.c: Likewise. * ipc/mach_debug.c: Likewise. * ipc/mach_msg.c: Likewise. * ipc/mach_port.c: Likewise. * ipc/mach_rpc.c: Likewise. * kern/act.c: Likewise. * kern/exception.c: Likewise. * kern/ipc_mig.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/lock_mon.c: Likewise. * kern/mach_clock.c: Likewise. * kern/machine.c: Likewise. * kern/printf.c: Likewise. * kern/priority.c: Likewise. * kern/startup.c: Likewise. * kern/syscall_emulation.c: Likewise. * kern/syscall_subr.c: Likewise. * kern/thread_swap.c: Likewise. * kern/time_stamp.c: Likewise. * kern/timer.c: Likewise. * kern/xpr.c: Likewise. * vm/memory_object.c: Likewise. * vm/vm_debug.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_kern.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_pageout.c: Likewise. * vm/vm_user.c: Likewise.
2014-04-04Fix prototypeSamuel Thibault
* linux/dev/glue/block.c (device_set_status): Fix prototype.
2014-04-04Use explicit prototypes for struct dev_ops fieldsMarin Ramesa
* device/conf.h: Include <sys/types.h>, <mach/port.h>, <mach/vm_prot.h>. Predefine struct io_req, io_req_t and io_return_t. (dev_ops): Add explicit prototypes for d_open, d_close, d_read, d_write, d_getstat, d_setstat, d_mmap, d_port_death. (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): Add prototypes. (nomap): Fix prototype. * device/dev_name.c (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): New functions. (nomap): Fix prototype. * device/ds_routines.c (dev_close): Pass 0 as flag parameter. * device/kmsg.c (kmsgclose): Drop return value. * device/kmsg.h (kmsgclose): Fix prototype. * i386/i386at/com.c (comopen): Fix prototype. (comclose): Fix prototype, drop return value. (comread, comwrite): Fix prototype. * i386/i386at/com.h (comopen, comclose, comread, comwrite): Fix prototype. * i386/i386at/conf.c (dev_ops): Use nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath where appropriate. * i386/i386at/kd.c (kdclose, kdread, kdwrite, kdmmap): Fix prototype. * i386/i386at/kd.h (kdclose, kdread, kdwrite, kdmmap): Likewise. * i386/i386at/kd_event.c (kbdopen): Likewise. * i386/i386at/kd_event.h (kbdopen): Likewise. * i386/i386at/kd_mouse.c (mouseopen): Likewise. * i386/i386at/kd_mouse.h (mouseopen): Likewise. * i386/i386at/lpr.c (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/lpr.h (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/mem.c (memmmap): Likewise. * i386/i386at/mem.h (memmmap): Likewise. * i386/i386at/model_dep.c (timemmap): Likewise. * i386/i386at/model_dep.h (timemmap): Likewise. * kern/mach_clock.c (timeopen, timeclose): Likewise. * kern/mach_clock.h: Include <sys/types.h>, predefine struct io_req and io_req_t. (timeopen, timeclose): Fix prototype.
2014-03-28Assume EGA/VGA cardSamuel Thibault
CGA and MONO cards are more than hard to find nowadays, and some buggy BIOSes claim running them nowadays... * i386/i386at/kd.c (kd_xga_init): Do not handle CGA and MONO cases any more, which thus default to EGA/VGA.
2014-03-28Really default to EGA/VGA on unknown CMOS valuesSamuel Thibault
* i386/i386at/kd.c (kd_xga_init): Use CM_EGA_VGA behavior as default case for unknown values of CMOS data.
2014-03-26kern: fix formatting of multiboot modulesJustus Winter
Previously, bootstrap_create would print the multiboot modules with padding applied to the end of the line. As multiboot modules as used by the Hurd span more than one line. This makes the list of modules hard to read and it looks unclean, more like an accident. Furthermore, it is not clear what the intend of this was, as the padding is applied at the end of the line, with no further information printed thereafter. * kern/bootstrap.c (bootstrap_create): Remove variable maxlen and len, update printfs.
2014-03-25include: make the memory_object_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the MEMORY_OBJECT_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/mach/mach_types.defs (memory_object_t): Make the translation mutable using preprocessor macros. * include/mach/memory_object.defs: Likewise for the inlined type declarations. Honor MEMORY_OBJECT_IMPORTS. * include/mach/memory_object_default.defs: Likewise.
2014-03-22Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2014-03-22Fix overflowSamuel Thibault
We were filling much more than the mapwindows array, thus overwriting in at least debugger variables. * i386/intel/pmap.c (pmap_bootstrap): Make sure to limit mapwindows initialization within PMAP_NMAPWINDOWS.
2014-03-20xen: fix error handlingJustus Winter
Previously, the error KERN_RESOURCE_SHORTAGE was not properly propagated. Found using the Clang Static Analyzer. * xen/block.c (device_open): Fix error handling, remove unused label. * xen/net.c (device_open): Likewise.
2014-03-20Only complain once per boot about Xen console smashSamuel Thibault
* xen/console.c (hypputc): Make `complain' variable static.
2014-03-17Increase possible number of AHCI devices to 8Samuel Thibault
by reducing possible number of partitions to 32. * linux/dev/drivers/block/ahci.c (MAX_PORTS): Set to 8. (PARTN_BITS): Set to 5.
2014-03-03Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2014-03-03Keep two virtual pages as mapping windows to access physical memorySamuel Thibault
PCI devices expose their memory etc. way beyond last_phys_addr. Userland drivers opening /dev/mem need to open those too, even if phystokv() will not work for them. * i386/intel/pmap.h (pmap_mapwindow_t): New type. (pmap_get_mapwindow, pmap_put_mapwindow): New prototypes. (PMAP_NMAPWINDOWS): New macro. * i386/intel/pmap.c (mapwindows): New array. (pmap_get_mapwindow, pmap_put_mapwindow): New functions. (pmap_bootstrap, pmap_virtual_space): Reserve virtual pages for the mapping windows. * i386/i386/phys.c: Include <i386/model_dep.h> (INTEL_PTE_W, INTEL_PTE_R): New macros (pmap_zero_page, pmap_copy_page, copy_to_phys, copy_from_phys): Use `pmap_get_mapwindow' to temporarily map physical pages beyond last_phys_addr.
2014-02-26kern: fix mig_strncpyJustus Winter
Previously, the function mig_strncpy would always zero-terminate the destination string. Make mig_strncpy behave like mig_strncpy and strncpy in the glibc. Also fix the implementation of mig_strncpy to return the length of the written string to align the implementation with the declaration in include/mach/mig_support.h. * kern/ipc_mig.c (mig_strncpy): Do not zero-terminate the destination string. Return length of destination string.
2014-02-23Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2014-02-23AHCI driver cleanupsSamuel Thibault
* linux/dev/drivers/block/ahci.c (struct port): Add id and is_cd fields. (ahci_end_request): Only print error if quiet flag of the request is not set. (ahci_do_port_request): Upgrade sector parameter to 64 bit. Include those bits in the LBA48 request. (ahci_do_request): Upgrade sector count to 64bit. Only print errors if quiet flag of the request is not set. (ahci_probe_port): Move identify code... (ahci_identify): ... to new function. Handle WIN_PIDENTIFY case to recognize ATAPI devices. (ahci_probe_port): Also try WIN_PIDENTIFY command. (ahci_geninit): Avoid checking partition table on empty devices.
2014-02-19include: skip routines related to migrating threadsJustus Winter
* include/mach/mach_port.defs: Skip the routines mach_port_set_rpcinfo and mach_port_create_act if MIGRATING_THREADS is not defined.
2014-02-12Reduce kmem_map to make room for kentry_data_sizeSamuel Thibault
* kern/slab.c (KMEM_MAP_SIZE): Decrease from 128MiB to 96MiB.
2014-02-10Make open return ENXIO on missing CD-ROMSamuel Thibault
* linux/src/drivers/block/ide-cd.c (ide_cdrom_open): Return -ENXIO when CD sense failed.
2014-02-10Add quiet flag to CD I/OSamuel Thibault
* linux/src/drivers/block/ide-cd.c (cdrom_queue_packet_command): Add `quiet' parameter, copied into the request. (cdrom_decode_status): Do not print I/O error when `quiet' field of request is non-zero. (cdrom_end_request): Do not print sense results when `quiet' field of request is non-zero. (cdrom_check_status, cdrom_read_capacity, cdrom_read_tocentry): Pass 1 to `cdrom_queue_packet_command''s `quiet' parameter. (cdrom_lockdoor, cdrom_eject, cdrom_pause, cdrom_startstop, cdrom_read_subchannel, cdrom_mode_sense, cdrom_mode_select, cdrom_play_lba_range_1, cdrom_read_block, cdrom_load_unload, ide_cdrom_ioctl): Pass 0 to `cdrom_queue_packet_command''s `quiet' parameter.
2014-02-10Add missing initializationSamuel Thibault
* linux/src/drivers/block/ide.c (ide_init_drive_cmd): Initialize `quiet' field of request to 0;
2014-02-10Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2014-02-10Add quiet flag to block I/OSamuel Thibault
This avoids grub & such making Mach print flurries of floppy errors. * linux/dev/include/linux/blkdev.h (request): Add `quiet' field. * linux/dev/include/linux/blk.h (end_request): Print I/O error only if the `quiet' field of the request is 0. * linux/dev/include/linux/fs.h (ll_rw_block): Add `quiet' parameter. * linux/dev/glue/block.c (ll_rw_block): Add `quiet' parameter, copied into the request. (bread, rdwr_partial, rdwr_full): Pass 0 to `ll_rw_block''s `quiet' parameter. * linux/dev/drivers/block/floppy.c (floppy_revalidate): Pass 1 to `ll_rw_block''s `quiet' parameter.
2014-02-06vm: trigger garbage collection on kernel memory pressureRichard Braun
In addition to physical pages, the slab allocator also consumes kernel virtual memory, so reclaim pages on failure to allocate from a kernel map. This method isn't foolproof but helps alleviate fragmentation. * vm/vm_kern.c (kmem_alloc): Call slab_collect and retry allocation once on failure. (kmem_realloc): Likewise. (kmem_alloc_wired): Likewise. (kmem_alloc_wired): Likewise. (kmem_alloc_aligned): Likewise.
2014-02-05Remove duplicate typedefSamuel Thibault
* device/net_io.c (net_rcv_port_t, net_hash_entry_t, net_hash_header_t): Remove duplicate typedefs.
2014-02-05doc: document task_set_nameJustus Winter
* doc/mach.texi (Task Information): Document the new task_set_name procedure.
2014-02-05include: add task_set_nameJustus Winter
task_set_name sets the name of a task. This is a debugging aid. The name will be used in error messages printed by the kernel. * include/mach/gnumach.defs (task_set_name): New procedure.
2014-02-05kern: implement task_set_nameJustus Winter
task_set_name sets the name of a task. This is a debugging aid. The name will be used in error messages printed by the kernel. * kern/task.c (task_set_name): New function. * kern/task.h (task_set_name): New declaration.
2014-02-04Fix comstart when the queue is emptySamuel Thibault
Found by Coverity * i386/i386at/com.c (comstart): Make `nch' an int. When `getc' returns -1, just return.
2014-02-04Fix potential NULL dereferenceSamuel Thibault
Found by Coverity * i386/i386/user_ldt.c (i386_get_ldt): Fetch `pcb' field of `thread' only after looking for `thread' being NULL.
2014-02-04Fix potential NULL dereferenceSamuel Thibault
* vm/vm_kern.c (projected_buffer_deallocate): Look for `map' being NULL or kernel_map before locking it.
2014-02-04Fix potential NULL dereferenceSamuel Thibault
Found by Coverity * i386/i386/db_trace.c (db_find_kthread): Handle case when task is NULL.
2014-02-04Fix potential NULL dereferenceSamuel Thibault
Found by Coverity. * i386/i386at/com.c (comopen): On com_reprobe() returning success, check for `isai' again.
2014-02-04xen: fix buffer sizeJustus Winter
Previously, only strlen(device_name) bytes were allocated, missing one byte for the terminating zero. * xen/block.c (hyp_block_init): Fix buffer size.
2014-02-04ddb: safely copy symbol names into the symtab structureJustus Winter
Use strncpy instead of strcpy to copy the name of a symbol into the symtab structure. Make sure that the string is properly terminated. Found using Coverity. * ddb/db_sym.c (db_add_symbol_table): Use strncpy instead of strcpy, ensure string termination.
2014-02-04kern: make kmem_error panicJustus Winter
The slab allocator relies on the fact that kmem_cache_error does not return. Previously, kmem_error was using printf. Use panic instead. Found using the Clang Static Analyzer. * kern/slab.c (kmem_error): Use panic instead of printf.