summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-03-14Simplify splxSamuel Thibault
* i386/i386/spl.S (splx): Use S_ARG0 instead of reimplementing it.
2012-03-14Fix variable types according to assembly useSamuel Thibault
* linux/dev/arch/i386/kernel/irq.c (intr_count): Set to int type. * linux/dev/kernel/softirq.c (bh_active, bh_mask): Likewise. (linux_soft_intr: active, mask, left): Likewise * linux/src/include/linux/interrupt.h (bh_active, bh_mask): Likewise. * linux/src/kernel/softirq.c (intr_count, bh_active, bh_mask): Likewise. (do_bottom_half: active, mask, left): Likewise
2012-03-14Stick to binutils ELF scriptsSamuel Thibault
* i386/ldscript: Reformat to follow binutils version
2012-03-14Fix PAE page frame number mask.Samuel Thibault
* i386/intel/pmap.h (INTEL_PTE_PFN): Keep only 47bits, others are not usable.
2012-03-14Fix Xen bootstrap at virtual address above 1GiBSamuel Thibault
* i386/intel/pmap.h (lin2pdpnum): New macro. * i386/intel/pmap.c (pmap_set_page_readonly_init): Use lin2pdpnum macro instead of hardcoding 0.
2012-03-14Simplify i386at_initSamuel Thibault
* i386/i386at/model_dep.c (i386at_init): Do not copy linear into virtual kernel mapping when they are equal, and do not drop the former either. Use the function `i' variable.
2012-03-14Simplify kvtophysSamuel Thibault
* i386/i386/phys.c (kvtophys): Use pte_to_pa macro instead of reimplementing it.
2012-03-09Use unsigned long for addresses and sizesSamuel Thibault
TODO: remonter formats * i386/include/mach/i386/vm_types.h (vm_offset_t): Define to unsigned long. (signed32_t): Define to signed int. (unsigned32_t): Define to unsigned int. * i386/include/mach/sa/stdarg.h (__va_size): Use sizeof(unsigned long)-1 instead of 3. * include/mach/port.h (mach_port_t): Define to vm_offset_t instead of natural_t. * include/sys/types.h (size_t): Define to unsigned long instead of natural_t. * linux/src/include/asm-i386/posix_types.h (__kernel_size_t): Define to unsigned long. (__kernel_ssize_t): Define to long. * linux/src/include/linux/stddef.h (size_t): Define to unsigned long. * device/dev_pager.c (dev_pager_hash): Cast port to vm_offset_t insted of natural_t. (device_pager_data_request): Fix format. * device/ds_routines.c (ds_no_senders): Fix format. * i386/i386/io_map.c (io_map): Likewise. * i386/i386at/autoconf.c (take_dev_irq): Likewise. * i386/i386at/com.c (comattach): Likewise. * i386/i386at/lpr.c (lprattach): Likewise. * i386/i386at/model_dep.c (mem_size_init, mem_size_init, c_boot_entry): Likewise. * i386/intel/pmap.c (pmap_enter): Likewise. * ipc/ipc_notify.c (ipc_notify_port_deleted, ipc_notify_msg_accepted, ipc_notify_dead_name): Likewise. * ipc/mach_port.c (mach_port_destroy, mach_port_deallocate): Likewise. * kern/ipc_kobject.c (ipc_kobject_destroy): Likewise. * kern/slab.c (kalloc_init): Likewise. * vm/vm_fault.c (vm_fault_page): Likewise. * vm/vm_map.c (vm_map_pmap_enter): Likewise. * xen/block.c (device_read): Likewise. * device/net_io.c (bpf_match): Take unsigned long * instead of unsigned int *. (bpf_do_filter): Make mem unsigned long instead of long. * i386/i386/ktss.c (ktss_init): Cast pointer to unsigned long instead of unsigned. * i386/i386/pcb.c (stack_attach, switch_ktss): Cast pointers to long instead of int. * i386/i386/trap.c (dump_ss): Likewise. * ipc/ipc_hash.c (IH_LOCAL_HASH): Cast object to vm_offset_t. * ipc/mach_msg.c (mach_msg_receive, mach_msg_receive_continue): Cast kmsg to vm_offset_t instead of natural_t. * kern/pc_sample.c (take_pc_sample): Cast to vm_offset_t instead of natural_t. * kern/boot_script.c (sym, arg): Set type of `val' field to long instead of int. (create_task, builtin_symbols, boot_script_parse_line, boot_script_define_function): Cast to long instead of int. * kern/bootstrap.c (bootstrap_create): Likewise. * kern/sched_prim.c (decl_simple_lock_data): Likewise. * kern/printf.c (vsnprintf): Set size type to size_t. * kern/printf.h (vsnprintf): Likewise. * vm/vm_map.h (kentry_data_size): Fix type to vm_size_t. * vm/vm_object.c (vm_object_pmap_protect_by_page): Fix size parameter type to vm_size_t.
2012-03-08Move kentry_data_size initial value to headerSamuel Thibault
* vm/vm_map.h (KENTRY_DATA_SIZE): Define macro. * vm/vm_map.c (kentry_data_size): Initialize to KENTRY_DATA_SIZE.
2012-03-03Set default serial parameters to 8N1 instead of 7E1Gabriele Giacone
* i386/i386at/com.c (comcninit): Set LINE_CTL register to i8BITS instead of i7BITS|iPEN.
2012-02-19Fix format for string printSamuel Thibault
* linux/src/drivers/net/3c505.c (elp_sense): Use %s format for printing a mere string, not the string.
2012-02-19Fix format for string printSamuel Thibault
* linux/src/drivers/net/8390.c: Use %s format for printing a mere string, not the string.
2012-02-19Fix format for string printSamuel Thibault
* linux/src/drivers/net/3c503.c (el2_probe1): Use %s format for printing a mere string, not the string.
2012-02-19Fix format for string printSamuel Thibault
* linux/src/drivers/scsi/aha1542.c (aha1542_setup): Use %s format for printing a mere string, not the string.
2012-02-19Fix format for string printSamuel Thibault
* linux/src/drivers/scsi/advansys.c (asc_prt_line): Use %s format for printing a mere string, not the string.
2012-02-19Fix format for string printSamuel Thibault
* i386/i386at/model_dep.c (c_boot_entry): Use %s format for printing a mere string, not the string.
2012-01-28Merge branch 'master' into master-slabSamuel Thibault
2012-01-22Fix build on 64bit hostSamuel Thibault
When stealing the memset function from the 32bit host libc on a 64bit host system, glibc tends to bring unwanted references to _Unwind_Resume, __gcc_personality_v0, etc. So let's stop stealing memset. * kern/strings.c (memset): New function. * Makefile.am (clib_routines): Remove memset.
2012-01-09Improve ipc hash/marequest init readabilityRichard Braun
Use macros instead of raw numeric values. * ipc/ipc_hash.h (IPC_HASH_GLOBAL_SIZE): New macro. * ipc/ipc_hash.c (ipc_hash_init): Directly set the global hash table size to IPC_HASH_GLOBAL_SIZE. * ipc/ipc_marequest.h (IPC_MAREQUEST_SIZE): New macro. * ipc/ipc_marequest.c (ipc_marequest_init): Directly set the marequest hash table size to IPC_MAREQUEST_SIZE.
2011-12-30Cope with dom0s which do not respect feature-no-csum-offloadSamuel Thibault
Event with feature-no-csum-offload=1, some dom0s (such as Debian Squeeze's 2.6.32) send packets with a blank checksum. Recompute them before givin the packet to pfinet. * xen/net.c (recompute_checksum): New function. (hyp_net_intr): Call recompute_checksum when the checksum is blank but the data is validated.
2011-12-29Fix typoSamuel Thibault
2011-12-29Upgrade number of event queuesSamuel Thibault
* kern/sched_prim.c (NUMQUEUES): Increase to 1031
2011-12-17Remove arbitrary limits used by the zone systemRichard Braun
The zone allocator could limit the size of its zones to an arbitrary value set at zinit() time. There is no such parameter with the slab module. As a result of removing those limits, the kern/mach_param.h header becomes empty, and is simply removed altogether. * Makefrag.am (libkernel_a_SOURCES): Remove kern/mach_param.h. * i386/i386/fpu.c: Remove #include <kern/mach_param.h>. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * ipc/ipc_init.c: Likewise. (ipc_space_max): Remove variable. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_init.h (IPC_ZONE_TYPE): Remove macro. (ipc_space_max): Remove extern declaration. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_hash.c (ipc_hash_init): Don't use ipc_tree_entry_max to compute ipc_hash_global_size. * ipc/ipc_marequest.c: Remove #include <kern/mach_param.h>. (ipc_marequest_max): Remove variable. (ipc_marequest_init): Don't use ipc_marequest_max to compute ipc_marequest_size. (ipc_marequest_info): Return (unsigned int)-1 in maxp. * kern/act.c: Remove #include <kern/mach_param.h>. * kern/mach_clock.c: Likewise. * kern/priority.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_fault.c: Likewise.
2011-12-17Remove the defunct kernel_task_create() functionRichard Braun
The kmem_suballoc() function, which has been replaced with kmem_submap(), is called by kernel_task_create(). Rather than update it, remove this now unused function. * kern/task.c (kernel_task_create): Remove function. * kern/task.h (kernel_task_create): Remove prototype.
2011-12-17Fix kern/kalloc.h includesRichard Braun
* device/dev_pager.c: Remove #include <kern/kalloc.h>. * i386/i386/io_perm.c: Add #include <kern/kalloc.h>. * kern/bootstrap.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/pc_sample.c: Likewise. * kern/processor.c: Likewise. * kern/server_loop.ch: Likewise. * kern/thread.c: Likewise. * linux/dev/glue/block.c: Likewise. * linux/dev/glue/net.c: Likewise. * vm/vm_map.c: Likewise. * xen/block.c: Likewise. * xen/net.c: Likewise. * xen/store.c: Likewise.
2011-12-17Adjust VM initializationRichard Braun
Unlike the zone allocator, the slab code can't be fed with an initial chunk of memory. Some VM objects used early during startup now have to be statically allocated, and kernel map entries need a special path to avoid recursion when being allocated. * vm/vm_map.c (vm_submap_object_store): New variable. (vm_submap_object): Point to vm_submap_object_store. (kentry_data_size): Initialize to arbitrary value. (kentry_count): Remove variable. (kentry_pagealloc): New function. (vm_map_setup): Likewise. (vm_map_create): Replace initialization with a call to vm_map_setup(). * vm/vm_map.h (vm_map_setup): New prototype. * vm/vm_kern.c (kernel_map_store): New variable. (kernel_map): Point to kernel_map_store. (kmem_suballoc): Remove function. Replaced with... (kmem_submap): New function. (kmem_init): Call vm_map_setup() instead of vm_map_create(). * vm/vm_kern.h (kmem_suballoc): Remove prototype. (kmem_submap): New prototype. * vm/vm_object.c (kernel_object_store): New variable. (kernel_object): Point to kernel_object_store. (vm_object_template): Change type from vm_object_t to struct vm_object. (_vm_object_setup): New function. (_vm_object_allocate): Replace initialization with a call to _vm_object_setup(). (vm_object_bootstrap): Don't allocate vm_object_template, and use it as a structure instead of a pointer. Initialize kernel_object and vm_submap_object with _vm_object_setup() instead of _vm_object_allocate(). * vm/vm_resident.c (vm_page_bootstrap): Don't initialize kentry_data_size. * device/ds_routines.c (device_io_map_store): New variable. (device_io_map): Point to device_io_map_store. (mach_device_init): Call kmem_submap() instead of kmem_suballoc(). * ipc/ipc_init.c (ipc_kernel_map_store): New variable. (ipc_kernel_map): Point to ipc_kernel_map_store.
2011-12-17Adjust the kernel to use the slab allocatorRichard Braun
* device/dev_lookup.c: Replace zalloc header, types and function calls with their slab counterparts. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/io_req.h: Likewise. * device/net_io.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_perm.c: Likewise. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/task.h: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/pmap.h: Remove #include <kernel/zalloc.h>. * include/mach_debug/mach_debug.defs (host_zone_info): Replace routine declaration with skip directive. (host_slab_info): New routine declaration. * include/mach_debug/mach_debug_types.defs (zone_name_t) (zone_name_array_t, zone_info_t, zone_info_array_t): Remove types. (cache_info_t, cache_info_array_t): New types. * include/mach_debug/mach_debug_types.h: Replace #include <mach_debug/zone_info.h> with <mach_debug/slab_info.h>. * ipc/ipc_entry.c: Replace zalloc header, types and function calls with their slab counterparts. * ipc/ipc_entry.h: Likewise. * ipc/ipc_init.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_table.c (kalloc_map): Remove extern declaration. * kern/act.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/kalloc.h: Add #include <vm/vm_types.h>. (MINSIZE): Remove definition. (kalloc_map): Add extern declaration. (kget): Remove prototype. * kern/mach_clock.c: Adjust comment. * kern/processor.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/startup.c: Remove #include <kernel/zalloc.h>. * kern/task.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_init.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_page.h: Remove #include <kernel/zalloc.h>. * vm/vm_pageout.c: Replace zalloc header, types and function calls with their slab counterparts. * vm/vm_resident.c: Likewise. (zdata, zdata_size): Remove declarations. (vm_page_bootstrap): Don't steal memory for the zone system.
2011-12-17Import the slab allocatorRichard Braun
As it is intended to completely replace the zone allocator, remove it on the way. So long to the venerable code ! * Makefrag.am (libkernel_a_SOURCES): Add kern/slab.{c,h}, remove kern/kalloc.c and kern/zalloc.{c,h}. * configfrag.ac (SLAB_VERIFY, SLAB_USE_CPU_POOLS): Add defines. * i386/Makefrag.am (libkernel_a_SOURCES): Remove i386/i386/zalloc.h. * i386/configfrag.ac (CPU_L1_SHIFT): Remove define. * include/mach_debug/slab_info.h: New file. * kern/slab.c: Likewise. * kern/slab.h: Likewise. * i386/i386/zalloc.h: Remove file. * include/mach_debug/zone_info.h: Likewise. * kern/kalloc.c: Likewise. * kern/zalloc.c: Likewise. * kern/zalloc.h: Likewise.
2011-12-17Import utility filesRichard Braun
* Makefrag.am (libkernel_a_SOURCES): Add kern/list.h, kern/rbtree.c, kern/rbtree.h and kern/rbtree_i.h. * kern/list.h: New file. * kern/rbtree.c: Likewise. * kern/rbtree.h: Likewise. * kern/rbtree_i.h: Likewise. * kern/macro_help.h (MACRO_BEGIN): Use GNU C compound statement enclosed in parentheses. (MACRO_END): Likewise.
2011-11-27Keep frame pointer when debugger is enabledSamuel Thibault
* Makefrag.am (AM_CFLAGS) [enable_kdb]: Add -fno-omit-frame-pointer.
2011-10-16Merge branch 'master' of callisto:gnumachSamuel Thibault
2011-10-16Do not map xen driver pagesSamuel Thibault
* xen/block.c (hyp_block_init): Use vm_page_grab_phys_addr instead of kmem_alloc_wired to allocate driver pages. * xen/net.c (hyp_net_init): Likewise.
2011-10-16Increase kmem area for the Xen case.Samuel Thibault
Kernel tacks are 4 pages in the Xen case, so we need more kmem space. * i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE) [MACH_XEN]: Increase to 224MiB.
2011-10-10Raise block device interrupt level to SPL6Samuel Thibault
* linux/dev/drivers/block/genhd.c (device_setup): Set linux_intr_pri to SPL6. * linux/dev/glue/block.c (init_partition, device_open): Likewise.
2011-10-10Raise Linux kmem memory sizeSamuel Thibault
* linux/dev/glue/kmem.c (MEM_CHUNKS): Increase to 32.
2011-10-10Leave interrupts enabled in sym53c8xx driverSamuel Thibault
The driver can work with them, and request_irq works fine with them. * linux/src/drivers/scsi/sym53c8xx.c (ncr_attach): Do not pass SA_INTERRUPT to request_irq().
2011-10-09Define BITS_PER_LONG for Linux codeSamuel Thibault
* linux/src/include/asm-i386/types.h (BITS_PER_LONG): Define to 32.
2011-10-08Add sym53c8xx driver from linux 2.2Samuel Thibault
This driver supports qemu's SCSI host device. Unfortunately it seems to be breaking the network device, so test with care. * linux/Makefrag.am (liblinux_a_SOURCES): Add linux/src/drivers/scsi/sym53c8xx{.c,_comm.h,.h,_defs.h} * linux/configfrag.ac: Add AC_Linux_DRIVER([sym53c8xx] to enable CONFIG_SCSI_SYM53C8XX. * linux/dev/glue/kmem.c (MEM_CHUNKS): Increase to 16. * linux/src/drivers/scsi/hosts.c [CONFIG_SCSI_SYM53C8XX]: Include "sym53c8xx.h". (builtin_scsi_hosts): include SYM53C8XX.
2011-09-28fix copy out-of-line data when length >= 512MBSergio Lopez
* ipc/ipc_kmsg.c (ipc_kmsg_copyin_body): Change length type to unsigned64_t. Cast number to unsigned64_t. (ipc_kmsg_copyout_body): Likewise.
2011-09-28Make thread_suspend honor the TH_UNINT flagSergio López
Interrupting a thread without a continuation, puts it in a inconsistent state. This is the cause for the bug described in https://lists.gnu.org/archive/html/bug-hurd/2011-09/msg00148.html * kern/thread.c (thread_suspend): Fail with KERN_FAILURE if thread is uninterruptible.
2011-09-12Remove unused [!MACH_KERNEL] driver codeGuillem Jover
Use «unifdef -DMACK_KERNEL=1» as a starting point, but only remove the code not exposed on public headers, the rest is needed to build properly from userland. * device/cons.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (constty): Remove variable. (cninit, cnmaygetc) [MACH_KERNEL]: Remove preprocessor conditionals. [!MACH_KERNEL] (cnopen, cnclose, cnread, cnwrite, cnioctl, cnselect) (cncontrol): Remove functions. * device/cons.h (struct consdev) [MACH_KERNEL]: Remove preprocessor conditional. * device/kmsg.h [MACH_KERNEL]: Likewise. * i386/i386at/autoconf.c [!MACH_KERNEL]: Remove includes. * i386/i386at/kd_event.c [!MACH_KERNEL]: Likewise. [!MACH_KERNEL] (kbd_sel, kbdpgrp, kbdflag): Remove variables. [!MACH_KERNEL] (KBD_COLL, KBD_ASYNC, KBD_NBIO): Remove macros. (kbdopen, kbdclose, kbd_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (kbdioctl, kbdselect, kbdread): Remove functions. [!MACH_KERNEL] (X_kdb_enter_init, X_kdb_exit_init: Likewise. * i386/i386at/kd_mouse.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (mouse_sel, mousepgrp, mouseflag): Remove variables. [!MACH_KERNEL] (MOUSE_COLL, MOUSE_ASYNC, MOUSE_NBIO): Remove macros. (mouseopen, mouseclose, kd_mouse_read, mouse_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (mouseioctl, mouseselect, mouseread): Remove functions. * i386/i386at/lpr.c [!MACH_KERNEL]: Remove includes. (lpropen) [MACH_KERNEL]: Remove preprocessor conditionals. (lpropen, lprclose, lprstart) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (lprwrite, lprioctl, lprstop): Remove functions. * i386/i386at/rtc.c (readtodc, writetodc) [!MACH_KERNEL]: Remove code. * kern/mach_factor.c [MACH_KERNEL]: Remove preprocessor conditional. * xen/time.c (readtodc) [!MACH_KERNEL]: Remove code.
2011-09-09Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/gnumachSamuel Thibault
2011-09-09Do not take unused strpbrk() from libcGuillem Jover
* Makefile.am (clib_routines): Remove strpbrk.
2011-09-06* .gitignore: Tighten some rules, and distribute others to...Thomas Schwinge
* doc/.gitignore: ... here; * i386/i386/.gitignore: ... here; * tests/.gitignore: ..., and here.
2011-09-06* i386/i386/pcb.h (stack_attach): Parameterize the continuation parameter'sThomas Schwinge
parameter list. * i386/i386/pcb.c (stack_attach): Likewise.
2011-09-06Move i386/i386/locore.S declarations.Thomas Schwinge
* i386/i386/trap.c (recover_table, recover_table_end, retry_table) (retry_table_end): Move declarations to... * i386/i386/locore.h: ... here.
2011-09-06Further prototyping work for memory_object_proxy.c functions.Thomas Schwinge
* vm/memory_object_proxy.h: Add #includes. (memory_object_proxy_lookup): New declaration. * vm/memory_object_proxy.c: #include <vm/memory_object_proxy.h>. * vm/vm_user.c: Likewise. (memory_object_proxy_lookup): Drop declaration. Parts based on a patch by Fridolín Pokorný <fridolin.pokorny@gmail.com>.
2011-09-05Drop module memory free verbositySamuel Thibault
* kern/bootstrap.c (bootstrap_create): Do not show freed module memory.
2011-09-05Free memory used by boot modulesSamuel Thibault
* vm/vm_resident.c (pmap_startup): Warn when some pages could not be included in the allocator due to bad estimation. * kern/bootstrap.c: Include <vm/pmap.h>. (bootstrap_create): Call vm_page_create on bootstrap modules content.
2011-09-03Add prototypes for memory_object_proxy.c functionsFridolín Pokorný
* vm/memory_object_proxy.h: Add file. * vm/vm_init.c: Include <vm/memory_object_proxy.h>. * kern/ipc_kobject.c: Likewise. * Makefile.am (libkernel_a_SOURCES): Add vm/memory_object_proxy.h.