aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove duplicate typedefSamuel Thibault2014-02-051-4/+0
| | | | | * device/net_io.c (net_rcv_port_t, net_hash_entry_t, net_hash_header_t): Remove duplicate typedefs.
* doc: document task_set_nameJustus Winter2014-02-051-0/+11
| | | | | * doc/mach.texi (Task Information): Document the new task_set_name procedure.
* include: add task_set_nameJustus Winter2014-02-051-0/+9
| | | | | | | 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.
* kern: implement task_set_nameJustus Winter2014-02-052-0/+21
| | | | | | | | 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.
* Fix comstart when the queue is emptySamuel Thibault2014-02-041-1/+3
| | | | | | | Found by Coverity * i386/i386at/com.c (comstart): Make `nch' an int. When `getc' returns -1, just return.
* Fix potential NULL dereferenceSamuel Thibault2014-02-041-1/+2
| | | | | | | Found by Coverity * i386/i386/user_ldt.c (i386_get_ldt): Fetch `pcb' field of `thread' only after looking for `thread' being NULL.
* Fix potential NULL dereferenceSamuel Thibault2014-02-041-2/+4
| | | | | * vm/vm_kern.c (projected_buffer_deallocate): Look for `map' being NULL or kernel_map before locking it.
* Fix potential NULL dereferenceSamuel Thibault2014-02-041-0/+2
| | | | | | Found by Coverity * i386/i386/db_trace.c (db_find_kthread): Handle case when task is NULL.
* Fix potential NULL dereferenceSamuel Thibault2014-02-041-0/+2
| | | | | | | Found by Coverity. * i386/i386at/com.c (comopen): On com_reprobe() returning success, check for `isai' again.
* xen: fix buffer sizeJustus Winter2014-02-041-1/+1
| | | | | | | Previously, only strlen(device_name) bytes were allocated, missing one byte for the terminating zero. * xen/block.c (hyp_block_init): Fix buffer size.
* ddb: safely copy symbol names into the symtab structureJustus Winter2014-02-041-1/+2
| | | | | | | | | | 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.
* kern: make kmem_error panicJustus Winter2014-02-041-2/+2
| | | | | | | | | 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.
* kern: use kmem_warn instead of kmem_error in kmem_cache_errorJustus Winter2014-02-041-1/+1
| | | | | * kern/slab.c (kmem_cache_error): Use kmem_warn instead of kmem_error to print the cache name and its address.
* Fix FPU state copy sizeSamuel Thibault2014-02-041-2/+2
| | | | | * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix size of `user_fp_regs' access.
* Make empty while loops more prominentSamuel Thibault2014-02-041-9/+18
| | | | | | * i386/i386at/kd.c (kdintr, kd_senddata, kd_sendcmd, kd_getgata, kd_cmdreg_read, kd_cmdreg_write, kd_mouse_drain): Move semi colon of empty while loops on a single line to make it more visible.
* Fix FPU state accessSamuel Thibault2014-02-041-2/+2
| | | | | | | Found by coverity. * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound `user_fp_regs' access.
* Fix typoSamuel Thibault2014-02-041-1/+1
| | | | * i386/i386at/kd_mouse.c (mouseopen): Fix typo.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault2014-02-049-24/+50
|\
| * include: add a fixed-size string type for debugging purposesJustus Winter2014-02-012-0/+13
| | | | | | | | | | * include/mach/debug.defs: New file. * include/mach/debug.h: Likewise.
| * ipc: use the name of the task for error messagesJustus Winter2014-02-011-2/+2
| | | | | | | | | | | | * ipc/mach_port.c (mach_port_destroy): Use the name of the task for error messages. (mach_port_deallocate): Likewise.
| * kern: add a name field to struct taskJustus Winter2014-02-012-0/+12
| | | | | | | | | | | | * kern/task.c (task_create): Initialize name with the address of the task. * kern/task.h (TASK_NAME_SIZE): New definition. (struct task): Add field name.
| * kern: add snprintfJustus Winter2014-02-012-0/+11
| | | | | | | | | | * kern/printf.c (snprintf): New function. * kern/printf.h (snprintf): New declaration.
| * kern: include the mig-generated server headers in ipc_kobject.cJustus Winter2014-01-161-11/+12
| | | | | | | | | | | | | | | | | | 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.
| * vm: remove the declaration of memory_object_create_proxyJustus Winter2014-01-161-11/+0
| | | | | | | | | | | | | | | | It is not clear to me why the declaration was put there in the first place. It is not used anywhere, and it conflicts with the declaration generated by mig. * vm/memory_object_proxy.h (memory_object_create_proxy): Remove declaration.
* | Add missing breakSamuel Thibault2014-02-041-0/+1
|/ | | | | | Found by Coverity * i386/i386at/kd_mouse.c (mouseopen): Add missing break.
* kern: align kmem_cache objects using __cacheline_alignedJustus Winter2014-01-091-1/+2
| | | | | * kern/slab.h (struct kmem_cache): Align kmem_cache objects using __cacheline_aligned.
* include: add new file for cache-related definitionsJustus Winter2014-01-091-0/+25
| | | | | * include/cache.h (__cacheline_aligned): This macro can be used to align statically allocated objects so that they start at a cache line.
* kern: optimize the layout of struct kmem_cacheJustus Winter2014-01-061-6/+12
| | | | | * kern/slab.h (struct kmem_cache): Reorder the fields so that all hot fields are within the first cache line.
* kern: explain the significance of the chosen lengthJustus Winter2014-01-051-1/+3
| | | | | * kern/slab.h (KMEM_CACHE_NAME_SIZE): Explain the significance of the chosen length.
* linux: fix bit testsJustus Winter2014-01-051-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The pattern is !x&y. An expression of this form is almost always meaningless, because it combines a boolean operator with a bit operator. In particular, if the rightmost bit of y is 0, the result will always be 0. Fixed using coccinelle. // !x&y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: @@ expression E1,E2; @@ ( !E1 & !E2 | - !E1 & E2 + !(E1 & E2) ) * linux/src/drivers/scsi/FlashPoint.c: Fix bit tests.
* linux: fix bit testsJustus Winter2014-01-055-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pattern is !x&y. An expression of this form is almost always meaningless, because it combines a boolean operator with a bit operator. In particular, if the rightmost bit of y is 0, the result will always be 0. Fixed using coccinelle. // !x&y combines boolean negation with bitwise and // // Confidence: High // Copyright: (C) Gilles Muller, Julia Lawall, EMN, DIKU. GPLv2. // URL: http://www.emn.fr/x-info/coccinelle/rules/notand.html // Options: @@ expression E; constant C; @@ ( !E & !C | - !E & C + !(E & C) ) * linux/src/drivers/net/tlan.c: Fix bit tests. * linux/src/drivers/scsi/AM53C974.c: Likewise. * linux/src/drivers/scsi/FlashPoint.c: Likewise. * linux/src/drivers/scsi/NCR5380.c: Likewise. * linux/src/drivers/scsi/t128.c: Likewise.
* kern: make struct kmem_cache fit into two cache linesJustus Winter2014-01-031-1/+1
| | | | | | | | | | | | | | Previously, the size of struct kmem_cache was 136 bytes, just eight bytes larger than 128 bytes, which is typically two cache lines on today's CPUs. By reducing the size of the name field which holds a human-readable description by eight bytes to 24 bytes, the struct kmem_cache can be made fit into two cache lines. This change should not affect the usefulness of this field. For reference, the length of the largest hard-coded name is 17. * kern/slab.h (KMEM_CACHE_NAME_SIZE): Define to 24.
* kern: reduce the size of struct taskJustus Winter2014-01-031-3/+5
| | | | | * kern/task.h (struct task): Reduce the size of struct task by 2 * sizeof boolean_t by using a bit field for the boolean flags.
* vm: reduce the size of struct vm_pageJustus Winter2014-01-031-1/+1
| | | | | | | | | Previously, the bit field left 31 bits unused. By reducing the size of wire_count by one bit, the size of the whole struct is reduced by four bytes. * vm/vm_page.h (struct vm_page): Reduce the size of wire_count to 15 bits.
* vm: merge the two bit fields in struct vm_pageJustus Winter2014-01-031-7/+3
| | | | * vm/vm_page.h (struct vm_page): Merge the two bit fields.
* vm: remove NS32000-specific padding from struct vm_pageJustus Winter2014-01-031-3/+0
| | | | | | | Apparently, the NS32000 was a 32-bit CPU from the 1990ies. The string "ns32000" appears nowhere else in the source. * vm/vm_page.h (struct vm_page): Remove NS32000-specific padding.
* Make sure cursor is initializedSamuel Thibault2014-01-022-0/+21
| | | | | | | * i386/i386at/kd.c (kd_xga_init): Add start, stop variables, read them from CRT registers, make sure the cursor is enabled and is not reduced to 0, and write them back to CRT registers. * i386/i386at/kd.h (C_START, C_STOP): New macros.
* i386/include/mach/i386/mach_i386_types.h: add comments after else and endifMarin Ramesa2014-01-011-2/+2
| | | | * i386/include/mach/i386/mach_i386_types.h (MACH_KERNEL): Add comments after else and endif.
* Add comment after endifMarin Ramesa2014-01-011-1/+1
| | | | * i386/i386/io_perm.h (_I386_IO_PERM_H_): Add comment after endif.
* Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault2013-12-201-0/+4
|\
| * i386: add missing includesJustus Winter2013-12-181-0/+4
| | | | | | | | * i386/i386at/kd_event.h: Add missing includes.
* | Mark pure functions with attribute pureMarin Ramesa2013-12-2012-18/+18
| |
* | kern/strings.c (strlen): mark with attribute pureMarin Ramesa2013-12-201-1/+1
| | | | | | | | * kern/strings.c (strlen): Mark with attribute pure.
* | ddb/db_watch.c (db_watchpoint_cmd): remove forward declarationMarin Ramesa2013-12-201-1/+0
| | | | | | | | * ddb/db_watch.c (db_watchpoint_cmd) (db_option): Remove forward declaration.
* | Declare void argument lists (part 2)Marin Ramesa2013-12-2013-19/+19
|/ | | | | | | | Declare void argument lists that were not declared in the first part of this patch and * kern/sched_prim.h (recompute_priorities): Fix prototype. * kern/startup.c (setup_main) (recompute_priorities): Fix call.
* kern: avoid the casts in enqueue_head() and enqueue_tail()Marin Ramesa2013-12-173-3/+3
| | | | | | * kern/eventcount.c (simpler_thread_setrun) (enqueue_head) (th): Avoid the cast. * kern/thread.c (thread_halt_self) (enqueue_tail) (thread): Likewise. * kern/thread_swap.c (thread_swapin) (enqueue_tail) (thread): Likewise.
* Mark functions that don't return with attribute noreturnMarin Ramesa2013-12-1714-19/+19
|
* vm: qualify pointers whose dereferenced values are constant with constMarin Ramesa2013-12-179-21/+21
|
* util: qualify pointers whose dereferenced values are constant with constMarin Ramesa2013-12-172-5/+5
|
* kern: qualify pointers whose dereferenced values are constant with constMarin Ramesa2013-12-1716-54/+55
|