aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add missing distributed fileSamuel Thibault2015-07-051-1/+2
| | | | * Makefrag.am (EXTRA_DIST): Add ipc/notify.defs.
* Fix re-configuring out-of-tree buildsJustus Winter2015-06-301-1/+1
| | | | | | | | | | Previously, running `../configure ...' to reconfigure an out-of-tree build would link `machine' to `i386/i386' instead of `../i386/i386' (i.e. point to the build directory instead to the source) if `i386/i386' also exists in the build directory because of a previous build. * configfrag.ac: Prefix machine link target with `$srcdir'.
* Fix restoring interrupts on timeoutSamuel Thibault2015-06-301-0/+1
| | | | | * linux/dev/drivers/block/ahci.c (ahci_identify): Restore flags before returning on timeout.
* Print about powered-down AHCI portsSamuel Thibault2015-06-291-6/+40
| | | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Print messages when device is present but powered down.
* ddb: automatically display stack tracesJustus Winter2015-06-281-0/+4
| | | | | * ddb/db_trap.c (db_task_trap): Automatically display stack traces if an unexpected trap occurs.
* i386: improve the immediate consoleJustus Winter2015-06-289-14/+130
| | | | | | | | | | | | | | | | | | | Improve the immediate console to the point that it can be enabled and display e.g. assertion failures from very early on (i.e. from `c_boot_entry'). * device/cons.h (romgetc, romputc): New declarations. * i386/configfrag.ac: Add configuration variable. * i386/i386at/conf.c (dev_name_list): Add entry. * i386/i386at/cons_conf.c (constab): Add entry. * i386/i386at/immc.c: Add missing includes. (immc_cnprobe, immc_cninit, immc_cngetc, immc_romputc): New functions. (immc_cnputc): Fix signature, use virtual addresses. * i386/i386at/immc.h: New file. * i386/i386at/kd.c: Use `#if ENABLE_IMMEDIATE_CONSOLE'. * i386/i386at/kd.h (kd_setpos): Add missing declaration. * i386/i386at/model_dep.c (c_boot_entry): Install immediate console as early boot console.
* i386: add commentJustus Winter2015-06-261-0/+1
| | | | * i386/i386at/model_dep.c (rebootflag): Explain flag.
* kern: fix error handlingJustus Winter2015-06-201-1/+5
| | | | | | | This avoids calling `thread_deallocate' with an uninitialized value, as found by the Clang Static Analyzer. * kern/thread.c (kernel_thread): Fix error handling.
* kern: add function attributes to the printf-functionsJustus Winter2015-06-091-4/+9
| | | | | | * kern/printf.h (sprintf, snprintf, vsnprintf, printf): Add the `printf' function attribute that allows the compiler to check the format strings and arguments.
* Fix typoFlávio Cruz2015-06-051-1/+1
| | | | * vm/vm_kern.c (kmem_alloc_aligned): Fix typo.
* Use custom port macros.Flávio Cruz2015-06-051-2/+2
| | | | | * ipc/ipc_port.c (ipc_port_alloc_special): Use ip_alloc and ip_lock_init macros instead of manually inlining them.
* ipc: fix typoJustus Winter2015-05-311-1/+1
| | | | * ipc/notify.defs: Fix typo.
* Include the notify protocol in `gnumach.msgids'Justus Winter2015-05-313-1/+34
| | | | | | | * Makefrag.am (gnumach.msgids): Add `notify.msgids' as prerequisite. * Makerules.mig.am: Add rule to generate the list of message ids when neither the client nor the server stubs are required. * ipc/notify.defs: New file.
* kern: fix argument handlingJustus Winter2015-05-293-0/+8
| | | | | | | | | | Previously, the processor argument was not checked. If called with a non-processor argument (like a task), `processor' is set to NULL, triggering a page fault. Likewise for the other functions. * kern/processor.c (processor_get_assignment): Fix argument handling. * kern/task.c (task_get_assignment): Likewise. * kern/thread.c (thread_get_assignment): Likewise.
* Restrict `-fno-strict-aliasing' to the Linux driversJustus Winter2015-05-232-4/+5
| | | | | * Makefile.am: Move `-fno-strict-aliasing'... * linux/Makefrag.am: ... here.
* i386: avoid breaking the strict-aliasing rulesJustus Winter2015-05-231-1/+7
| | | | * i386/i386/pcb.c (switch_ktss): Cleanly convert the value.
* kern: avoid breaking the strict-aliasing rulesJustus Winter2015-05-231-1/+8
| | | | * kern/exception.c (exception_parse_reply): Use `BAD_TYPECHECK'.
* vm: drop unused `kmem_realloc'Justus Winter2015-05-232-103/+1
| | | | | | * vm/vm_kern.c (kmem_realloc): Remove function. (kmem_alloc_wired): Adopt comment. * vm/vm_kern.h (kmem_realloc): Remove declaration.
* Add stdint integer types in Linux glueSamuel Thibault2015-05-231-0/+9
| | | | | * linux/dev/include/linux/types.h (int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t): New types.
* ipc: drop remnants of the IPC tablesJustus Winter2015-05-222-94/+5
| | | | | | | | | | | * ipc/ipc_table.c (ipc_table_entries): Remove. (ipc_table_entries_size): Likewise. (ipc_table_init): Remove initialization of `ipc_table_entries'. (ipc_table_realloc): Remove function. * ipc/ipc_table.h: Adjust comments. (ipc_table_entries): Remove declaration. (ipc_table_realloc): Likewise. (it_entries_{alloc,reallocable,realloc,free}): Remove macros.
* ipc: drop size parameter from `ipc_space_create'Justus Winter2015-05-223-12/+2
| | | | | | * ipc/ipc_space.c (ipc_space_create): Drop size parameter. * ipc/ipc_space.h (ipc_space_create): Adopt declaration, fix comment. * kern/ipc_tt.c (ipc_task_init): Adopt accordingly.
* ipc: inline key ipc entry lookup functionsJustus Winter2015-05-203-128/+120
| | | | | | | | | | | Declare functions looking up IPC entries that were previously inlined manually with `static inline' so that they will be inlined into the fast paths by the compiler. * ipc/ipc_entry.c (ipc_entry_lookup, ipc_entry_get, ipc_entry_dealloc): Move functions... * ipc/ipc_space.h: ... here, and declare them as `static inline'. * ipc/ipc_entry.h: Drop associated declarations.
* ipc: replace the IPC table with a radix treeJustus Winter2015-05-2020-2880/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the port names are mapped to an IPC object (e.g. a port) using a table. This, however, requires large chunks of continuous memory, and leads to scalability problems as virtual kernel memory is a scarce resource. To avoid excessive overhead, non-contiguous port names are spilled into a splay tree. Replace the IPC table with a radix tree. As the radix tree is able to store non-contiguous names with reasonable overhead, we can drop the splay tree as well. * ipc/ipc_entry.c (ipc_entry_tree_collision): Remove function. (ipc_entry_cache): New variable. (ipc_entry_lookup): Replace with a radix tree lookup. (ipc_entry_get): The free list handling is changed a little. Adopt accordingly. (ipc_entry_free_name): New function. (ipc_entry_alloc): Adopt accordingly. (ipc_entry_alloc_name): Likewise. (ipc_entry_dealloc): Likewise. (ipc_entry_grow_table): Remove function. * ipc/ipc_entry.h (struct ipc_entry): Update comment, add field for name and free list, remove unused fields. (ipc_entry_cache, ie_alloc, ie_free): New declarations. (struct ipc_tree_entry): Remove. Also remove any related declarations. (ipc_entry_grow_table): Remove declaration. * ipc/ipc_init.c (ipc_bootstrap): Adopt initialization. * ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Use `ipc_entry_alloc' instead of re-coding it. Adopt free list handling. (ipc_kmsg_copyout_object): Adopt free list handling, store the name. * ipc/ipc_object.c (ipc_object_copyout): Likewise. (ipc_object_copyout_multiname): Likewise. * ipc/ipc_space.c (ipc_space_create): Initialize radix tree and free list. Drop table and splay tree initialization. (ipc_space_destroy): Free ipc entries and radix tree, remove table and splay tree cleanup. * ipc/ipc_space.h (struct ipc_space): Add radix tree, free list, and size. Remove all fields related to the table and splay tree. * ddb/db_print.c (db_port_iterate): Adopt iteration. (db_lookup_port): Adopt lookup. * include/mach_debug/ipc_info.h: Remove unused parts of the debug interface. * include/mach_debug/mach_debug.defs: Likewise. * include/mach_debug/mach_debug_types.defs: Likewise. * ipc/mach_debug.c: Likewise. * ipc/ipc_right.c (ipc_right_reverse): Adopt lookup, store name. (ipc_right_check): Adopt removal. (ipc_right_destroy): Likewise. (ipc_right_dealloc): Likewise. (ipc_right_delta): Likewise. (ipc_right_copyin): Adopt insertion, adopt removal. (ipc_right_copyin_two): Adopt removal. (ipc_right_copyout): Adopt insertion, adopt removal. (ipc_right_rename): Likewise, also update comment. * ipc/mach_port.c (mach_port_names): Adopt iteration. (mach_port_get_set_status): Likewise. * ipc/port.h: Update comment. * ipc/ipc_hash.c: Delete file. * ipc/ipc_hash.h: Likewise. * ipc/ipc_splay.c: Likewise. * ipc/ipc_splay.h: Likewise. * Makefrag.am (libkernel_a_SOURCES): Remove these files.
* ipc: replace reverse hash table with a radix treeJustus Winter2015-05-206-168/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, there is a hash table mapping (space, object) tuples to `ipc_entry' objects. This hash table is intertwined with the IPC tables. There is one hash table per IPC space, but it is only for the entries in the IPC table. This hash table is called `local' in the source. All IPC entries being spilled into the splay tree are instead mapped by a global hash table. Replace the local (i.e. per IPC space) reverse hash table with a radix tree. * ipc/ipc_entry.c (ipc_entry_grow_table): Adjust accordingly. * ipc/ipc_entry.h (struct ipc_entry): Adjust comment. * ipc/ipc_hash.c: Adjust comment explaining the local lookup table. (IPC_LOCAL_HASH_INVARIANT): New macro. (ipc_hash_local_lookup): Use the new `ipc_reverse_lookup' function. (ipc_hash_local_insert): Use the new `ipc_reverse_insert' function. (ipc_hash_local_delete): Use the new `ipc_reverse_remove' function. * ipc/ipc_space.c (ipc_space_create): Initialize radix tree. (ipc_space_destroy): Free radix tree. * ipc/ipc_space.h (struct ipc_space): Add radix tree. (ipc_reverse_insert): New function. (ipc_reverse_remove): Likewise. (ipc_reverse_remove_all): Likewise. (ipc_reverse_lookup): Likewise. * ipc/ipc_right.c (ipc_right_clean): Update comment.
* ipc: undo manual inlining of `ipc_entry_X' functionsJustus Winter2015-05-204-221/+57
| | | | | | | | | | | Today we can rely on the compiler to inline functions. Undoing this manual optimization is a first step to replace the IPC tables. * ipc/mach_msg.c (mach_msg_trap): Undo the manual inlining of `ipc_entry_lookup', `ipc_entry_dealloc', and `ipc_entry_get'. * ipc/ipc_kmsg.c (ipc_kmsg_copyin_header, ipc_kmsg_copyout_header): Likewise. * kern/exception.c (exception_raise): Likewise. * kern/ipc_mig.c (fast_send_right_lookup): Likewise.
* kern: add radix tree libraryJustus Winter2015-05-206-0/+1111
| | | | | | | | | | | Import a radix tree library from Richard Braun's librbraun. * Makefile.am (clib_routines): Steal `__ffsdi2'. * Makefrag.am (libkernel_a_SOURCES): Add new files. * kern/rdxtree.c: New file. * kern/rdxtree.h: Likewise. * kern/rdxtree_i.h: Likewise. * kern/startup.c (setup_main): Initialize radix tree library.
* kern: gracefully handle resource shortageJustus Winter2015-05-204-10/+22
| | | | | | | | | * kern/thread.c (stack_alloc): Report resource shortage. * kern/sched_prim.h (stack_alloc): Adjust declaration accordingly. * kern/thread_swap.c (thread_doswapin): Report resource shortage. (swapin_thread_continue): If the swap-in fails, put the thread back on the queue and go back to sleep. * kern/thread_swap.h (thread_doswapin): Adjust declaration accordingly.
* vm: gracefully handle resource shortageJustus Winter2015-05-201-14/+12
| | | | | | * vm/vm_object.c (vm_object_copy_call): Gracefully handle resource shortage by doing the allocation earlier and aborting the function if unsuccessful.
* kern: gracefully handle resource shortageJustus Winter2015-05-201-3/+2
| | | | * kern/task.c (task_create): Gracefully handle resource shortage.
* kern: import `macros.h' from x15Justus Winter2015-05-1931-84/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import the macro definitions from the x15 kernel project, and replace all similar definitions littered all over the place with it. Importing this file will make importing code from the x15 kernel easier. We are already using the red-black tree implementation and the slab allocator from it, and we will import even more code in the near future. * kern/list.h: Do not define `structof', include `macros.h' instead. * kern/rbtree.h: Likewise. * kern/slab.c: Do not define `ARRAY_SIZE', include `macros.h' instead. * i386/grub/misc.h: Likewise. * i386/i386/xen.h: Do not define `barrier', include `macros.h' instead. * kern/macro_help.h: Delete file. Replaced by `macros.h'. * kern/macros.h: New file. * Makefrag.am (libkernel_a_SOURCES): Add new file, remove old file. * device/dev_master.h: Adopt accordingly. * device/io_req.h: Likewise. * device/net_io.h: Likewise. * i386/intel/read_fault.c: Likewise. * ipc/ipc_kmsg.h: Likewise. * ipc/ipc_mqueue.h: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_port.h: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_splay.c: Likewise. * ipc/ipc_splay.h: Likewise. * kern/assert.h: Likewise. * kern/ast.h: Likewise. * kern/pc_sample.h: Likewise. * kern/refcount.h: Likewise. * kern/sched.h: Likewise. * kern/sched_prim.c: Likewise. * kern/timer.c: Likewise. * kern/timer.h: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_map.h: Likewise. * vm/vm_object.h: Likewise. * vm/vm_page.h: Likewise.
* i386: avoid compiler warningJustus Winter2015-05-171-10/+15
| | | | | | * i386/i386/phys.c (pmap_zero_page, pmap_copy_page, copy_to_phys, copy_from_phys): Avoid compiler warning about `map' being used uninitialized.
* i386: use macro to compute address of saved registersJustus Winter2015-05-141-2/+2
| | | | | * i386/i386/pcb.c (stack_attach): Use `USER_REGS'. (stack_handoff): Likewise.
* Fix semaphore failure path special calling conventionSamuel Thibault2015-05-021-3/+7
| | | | | | | * linux/src/include/asm-i386/semaphore.h (down): Pass semaphore address to down_failed through ecx. (down_interruptible): Likewise to down_failed_interruptible. (up): Likewise to up_wakeup.
* kern: fix commentJustus Winter2015-05-021-2/+2
| | | | * kern/rbtree.h: Fix comment.
* Fix warningSamuel Thibault2015-05-021-2/+4
| | | | | * i386/i386at/rtc.c (rtcget, rtcput): Make functions take an rtc_st structure which it casts to char * itself.
* Fix warningsSamuel Thibault2015-05-021-64/+60
| | | | | | | | * device/ds_routines.c (device_open, ds_open_done, device_close, device_write, device_write_inband, ds_write_done, device_read, device_read_inband, ds_read_done, device_set_status, mach_device_get_status, device_set_filter, device_map, ds_no_senders): Convert from K&R declaration, fix type of `device' into void*.
* Fix block_io_mmap prototypeSamuel Thibault2015-05-022-2/+2
| | | | | * device/blkio.c (block_io_mmap): Fix prototype of dummy function. * device/blkio.h (block_io_mmap): Likewise.
* Use gnu89 inline styleSamuel Thibault2015-05-011-0/+4
| | | | * Makefile.am (AM_CFLAGS): Add -fgnu89-inline option.
* Replace clobbers with earlyclobbersSamuel Thibault2015-05-012-15/+17
| | | | | | | | | Newer gccs consider the former "impossible" * linux/src/include/asm-i386/bitops.h (find_first_zero_bit): Replace clobbers with earlyclobbers. * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up): Likewise.
* Fix build with gcc-5Samuel Thibault2015-04-301-0/+67
| | | | * linux/src/include/linux/compiler-gcc5.h: New file.
* kern: avoid hardcoding the lowest priorityJustus Winter2015-04-241-2/+2
| | | | | | | | The number of priorities has been changed from 32 to 50 in 6a234201081156e6d5742e7eeabb68418b518fad. * kern/syscall_subr.c (thread_depress_priority): Avoid hardcoding the lowest priority.
* kern: disable stack allocation counters by defaultJustus Winter2015-04-233-8/+13
| | | | | | | | | Disable the stack allocation counters by default. Casual checking revealed that the hits-to-miss ratio is excellent. * kern/thread.c (stack_alloc_{hits,misses,max}): Move variables... * kern/counters.c: ... here, and add the usual counter prefix. * kern/counters.h: New declarations.
* Avoid accessing ip_protected_payload without the lock.Samuel Thibault2015-04-232-10/+25
| | | | | | | * ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Avoid accessing dest->ip_protected_payload without the lock. * ipc/mach_msg.c (ipc/mach_msg.c): Avoid accessing dest_port->ip_protected_payload without the lock.
* Prepend 0x to hexadecimal offsetSamuel Thibault2015-04-231-1/+1
| | | | * i386/i386/db_trace.c (db_i386_stack_trace): Prepend 0x to hexadecimal offset.
* GNU Mach 1.5.Thomas Schwinge2015-04-102-5/+3
| | | | | * version.m4 (AC_PACKAGE_VERSION): Set to 1.5. * NEWS: Finalize for 1.5.
* Give the Debian package name for the non-multilib libc.aSamuel Thibault2015-03-191-2/+2
| | | | * Makefile.am (clib-routines.o): Mention the Debian libc6-dev:i386 package.
* Remove spl debugging in Xen caseSamuel Thibault2015-03-081-4/+4
| | | | | | xen cli/sti doesn't use IF * i386/i386/spl.S [MACH_XEN]: Disable IF check.
* Show odd number of portsSamuel Thibault2015-03-051-1/+1
| | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Show odd number of ports.
* Use printf_once instead of recoding itSamuel Thibault2015-02-262-16/+2
| | | | | * i386/i386at/kd_event.c: Call printf_once instead of recoding it. * i386/i386at/kd_mouse.c: Likewise.
* Limit printing "queue full" messagesSamuel Thibault2015-02-262-2/+16
| | | | | | * i386/i386at/kd_event.c (kbd_enqueue): Print "queue full" warning only once. * i386/i386at/kd_mouse.c (mouse_enqueue): Likewise.