summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2014-02-04kern: use kmem_warn instead of kmem_error in kmem_cache_errorJustus Winter
* kern/slab.c (kmem_cache_error): Use kmem_warn instead of kmem_error to print the cache name and its address.
2014-02-04Fix FPU state copy sizeSamuel Thibault
* i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix size of `user_fp_regs' access.
2014-02-04Make empty while loops more prominentSamuel Thibault
* 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.
2014-02-04Fix FPU state accessSamuel Thibault
Found by coverity. * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound `user_fp_regs' access.
2014-02-04Fix typoSamuel Thibault
* i386/i386at/kd_mouse.c (mouseopen): Fix typo.
2014-02-04Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2014-02-04Add missing breakSamuel Thibault
Found by Coverity * i386/i386at/kd_mouse.c (mouseopen): Add missing break.
2014-02-01include: add a fixed-size string type for debugging purposesJustus Winter
* include/mach/debug.defs: New file. * include/mach/debug.h: Likewise.
2014-02-01ipc: use the name of the task for error messagesJustus Winter
* ipc/mach_port.c (mach_port_destroy): Use the name of the task for error messages. (mach_port_deallocate): Likewise.
2014-02-01kern: add a name field to struct taskJustus Winter
* 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.
2014-02-01kern: add snprintfJustus Winter
* kern/printf.c (snprintf): New function. * kern/printf.h (snprintf): New declaration.
2014-01-16kern: include the mig-generated server headers in ipc_kobject.cJustus 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.
2014-01-16vm: remove the declaration of memory_object_create_proxyJustus Winter
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.
2014-01-09kern: align kmem_cache objects using __cacheline_alignedJustus Winter
* kern/slab.h (struct kmem_cache): Align kmem_cache objects using __cacheline_aligned.
2014-01-09include: add new file for cache-related definitionsJustus Winter
* include/cache.h (__cacheline_aligned): This macro can be used to align statically allocated objects so that they start at a cache line.
2014-01-06kern: optimize the layout of struct kmem_cacheJustus Winter
* kern/slab.h (struct kmem_cache): Reorder the fields so that all hot fields are within the first cache line.
2014-01-05kern: explain the significance of the chosen lengthJustus Winter
* kern/slab.h (KMEM_CACHE_NAME_SIZE): Explain the significance of the chosen length.
2014-01-05linux: fix bit testsJustus Winter
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.
2014-01-05linux: fix bit testsJustus Winter
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.
2014-01-03kern: make struct kmem_cache fit into two cache linesJustus Winter
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.
2014-01-03kern: reduce the size of struct taskJustus Winter
* 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.
2014-01-03vm: reduce the size of struct vm_pageJustus Winter
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.
2014-01-03vm: merge the two bit fields in struct vm_pageJustus Winter
* vm/vm_page.h (struct vm_page): Merge the two bit fields.
2014-01-03vm: remove NS32000-specific padding from struct vm_pageJustus Winter
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.
2014-01-02Make sure cursor is initializedSamuel Thibault
* 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.
2014-01-01i386/include/mach/i386/mach_i386_types.h: add comments after else and endifMarin Ramesa
* i386/include/mach/i386/mach_i386_types.h (MACH_KERNEL): Add comments after else and endif.
2014-01-01Add comment after endifMarin Ramesa
* i386/i386/io_perm.h (_I386_IO_PERM_H_): Add comment after endif.
2013-12-20Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2013-12-20Mark pure functions with attribute pureMarin Ramesa
2013-12-20kern/strings.c (strlen): mark with attribute pureMarin Ramesa
* kern/strings.c (strlen): Mark with attribute pure.
2013-12-20ddb/db_watch.c (db_watchpoint_cmd): remove forward declarationMarin Ramesa
* ddb/db_watch.c (db_watchpoint_cmd) (db_option): Remove forward declaration.
2013-12-20Declare void argument lists (part 2)Marin Ramesa
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.