aboutsummaryrefslogtreecommitdiff
path: root/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Fallback on direct PCI access when no BIOS32 is availableSamuel Thibault2016-01-291-0/+2
| | | | | | | | | Some hardware start shippping with no BIOS32 at all, and we'll have to implement ACPI to get the address of the mmconfig table. In the meanwhile, we can hope that the direct probe works (it does on HP820 for instance). * linux/src/arch/i386/kernel/bios32.c (pcibios_init): Also try check_direct_pci() when bios32 probing failed.
* Use vm_page as the physical memory allocatorRichard Braun2016-01-234-143/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change replaces the historical page allocator with a buddy allocator implemented in vm/vm_page.c. This allocator allows easy contiguous allocations and also manages memory inside segments. In a future change, these segments will be used to service requests with special constraints, such as "usable for 16-bits DMA" or "must be part of the direct physical mapping". * Makefrag.am (libkernel_a_SOURCES): Add vm/vm_page.c. * i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386at/biosmem.{c,h}. * i386/i386/vm_param.h: Include kern/macros.h. (VM_PAGE_DMA_LIMIT, VM_PAGE_MAX_SEGS, VM_PAGE_DMA32_LIMIT, VM_PAGE_DIRECTMAP_LIMIT, VM_PAGE_HIGHMEM_LIMIT, VM_PAGE_SEG_DMA, VM_PAGE_SEG_DMA32, VM_PAGE_SEG_DIRECTMAP, VM_PAGE_SEG_HIGHMEM): New macros. * i386/i386at/model_dep.c: Include i386at/biosmem.h. (avail_next, avail_remaining): Remove variables. (mem_size_init): Remove function. (i386at_init): Initialize and use the biosmem module for early physical memory management. (pmap_free_pages): Return phys_last_addr instead of avail_remaining. (init_alloc_aligned): Turn into a wrapper for biosmem_bootalloc. (pmap_grab_page): Directly call init_alloc_aligned instead of pmap_next_page. * i386/include/mach/i386/vm_types.h (phys_addr_t): New type. * kern/bootstrap.c (free_bootstrap_pages): New function. (bootstrap_create): Call free_bootstrap_pages instead of vm_page_create. * kern/cpu_number.h (CPU_L1_SIZE): New macro. * kern/slab.h: Include kern/cpu_number.h. (CPU_L1_SIZE): Remove macro, moved to kern/cpu_number.h. * kern/startup.c (setup_main): Change the value of machine_info.memory_size. * linux/dev/glue/glue.h (alloc_contig_mem, free_contig_mem): Update prototypes. * linux/dev/glue/kmem.c (linux_kmem_init): Don't use defunct page queue. * linux/dev/init/main.c (linux_init): Don't free unused memory. (alloc_contig_mem, free_contig_mem): Turn into wrappers for the vm_page allocator. * linux/pcmcia-cs/glue/ds.c (PAGE_SHIFT): Don't undefine. * vm/pmap.h (pmap_startup, pmap_next_page): Remove prototypes. * vm/vm_fault.c (vm_fault_page): Update calls to vm_page_convert. * vm/vm_init.c (vm_mem_init): Call vm_page_info_all. * vm/vm_object.c (vm_object_page_map): Update call to vm_page_init. * vm/vm_page.h (vm_page_queue_free): Remove variable declaration. (vm_page_create, vm_page_release_fictitious, vm_page_release): Remove declarations. (vm_page_convert, vm_page_init): Update prototypes. (vm_page_grab_contig, vm_page_free_contig): New prototypes. * vm/vm_resident.c (vm_page_template, vm_page_queue_free, vm_page_big_pagenum): Remove variables. (vm_page_bootstrap): Update and call vm_page_setup. (pmap_steal_memory): Update and call vm_page_bootalloc. (pmap_startup, vm_page_create, vm_page_grab_contiguous_pages): Remove functions. (vm_page_init_template, vm_page_grab_contig, vm_page_free_contig): New functions. (vm_page_init): Update and call vm_page_init_template. (vm_page_release_fictitious): Make static. (vm_page_more_fictitious): Update call to vm_page_init. (vm_page_convert): Rewrite to comply with vm_page. (vm_page_grab): Update and call vm_page_alloc_pa. (vm_page_release): Update and call vm_page_free_pa.
* Fix build with gcc-6Samuel Thibault2016-01-141-0/+67
| | | | * linux/src/include/linux/compiler-gcc6.h: New file.
* replace extern with static in some linux codeFlavio Cruz2016-01-028-29/+29
| | | | | | | | | | | * linux/dev/include/linux/fs.h: Replace extern with static. * linux/dev/include/linux/locks.h: Likewise. * linux/dev/include/linux/mm.h: Likewise. * linux/src/drivers/net/e2100.c: Likewise * linux/src/include/asm-i386/termios.h: Likewise. * linux/src/include/linux/interrupt.h: Likewise. * linux/src/include/net/route.h: Likewise. * linux/src/include/net/sock.h: Likewise.
* remove unnused disk code and headersFlavio Cruz2016-01-011-35/+0
| | | | | | | * i386/Makefrag.am: Remove disk.h. * i386/i386at/disk.h: Remove unnused definitions. * i386/include/mach/i386/disk.h: Remove. * linux/dev/glue/block.c (device_get_status): Remove V_GETPARMS case.
* fix some compiler warnings in gnumachFlavio Cruz2016-01-012-3/+3
| | | | | | | | * linux/dev/glue/block.c (out): Cast to device_t. * linux/dev/init/main.c (alloc_contig_mem): Initialize addr and cast return value to void *. * i386/i386/phys.c (pmap_copy_page): Initialize src_map. * i386/intel/pmap.c: Include i386at/model_dep.h. * kern/mach_clock.c (mapable_time_init): Cast to void *.
* Fix ahci unit MAX_PORTS checkSamuel Thibault2015-11-271-1/+1
| | | | | * linux/dev/drivers/block/ahci.c (ahci_do_request): Fix checking unit against MAX_PORTS.
* Fix missing format in printkSamuel Thibault2015-11-271-1/+1
| | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Add missing format.
* commit fce798016c4bd2be89b86b0d343ab54505409412Rik van Riel2015-09-071-1/+0
| | | | | | | | | [PATCH] advansys.c buffer overflow The Stanford checker found an error in advansys.c, the driver is accessing field 6 in an array[6]. Since this is the only place where this field is accessed it should be safe to simply remove this line.
* Avoid re-defining macrosJustus Winter2015-08-152-2/+8
| | | | | | * kern/macros.h: Avoid re-defining macros. * linux/src/include/linux/compiler-gcc.h: Likewise. * linux/src/include/linux/compiler.h: Likewise.
* linux/net: fix build with -O0Justus Winter2015-07-181-1/+1
| | | | * linux/src/drivers/net/pci-scan.c: Avoid #erroring out.
* Fix build with -O0Samuel Thibault2015-07-077-39/+55
| | | | | | | | | | | | | | | | | | | | | * linux/src/include/linux/string.h (strcpy, strncpy, strcat, strncat, strchr, strrchr, strlen, strnlen, strcmp, strncmp, memmove, memscan): Comment out extern declarations. * linux/dev/include/asm-i386/string.h (strcpy, strncpy, strcat, strncat, strcmp, strncmp, strchr, strrchr, strlen, __memcpy, __constant_memcpy, memmove, memchr, __memset_generic, __constant_c_memset, strnlen, __constant_c_and_count_memset, memscan): Turn extern inline into static inline. * linux/dev/include/linux/fs.h (mark_buffer_uptodate): Likewise. * linux/src/include/asm-i386/bitops.h (set_bit, clear_bit, change_bit, test_and_set_bit, test_and_clear_bit, test_and_change_bit, test_bit, find_first_zero_bit, find_next_zero_bit, ffz, ffs): Likewise. * linux/src/include/asm-i386/io.h (virt_to_phys, phys_to_virt, __out##s, __in##s, ins##s, outs##s): Likewise. * linux/src/include/asm-i386/semaphore.h (down, down_interruptible, up): Likewise. * linux/src/include/asm-i386/segment.h [!__OPTIMIZE]: Emit an ud2 instruction instead of an undefined reference.
* 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.
* Restrict `-fno-strict-aliasing' to the Linux driversJustus Winter2015-05-231-0/+5
| | | | | * Makefile.am: Move `-fno-strict-aliasing'... * linux/Makefrag.am: ... here.
* 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.
* 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.
* 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.
* Show odd number of portsSamuel Thibault2015-03-051-1/+1
| | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Show odd number of ports.
* linux: fix compiler warningJustus Winter2015-02-201-0/+1
| | | | | | | | If the loop above completes at least one iteration, `i' will be larger than zero. * linux/dev/glue/block.c (rdwr_full): Add assertion to appease the compiler.
* Fix programming PIT counterSamuel Thibault2014-11-231-1/+1
| | | | | * linux/dev/arch/i386/kernel/irq.c (init_IRQ): Properly mask 8 bits of PIT counter.
* Correct GCC's -Wformat-security issuesDavid Michael2014-11-2126-28/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * linux/pcmcia-cs/clients/axnet_cs.c (axdev_init): Add a format string literal where printk only has a single variable argument. * linux/src/drivers/net/3c507.c (el16_probe1): Likewise. * linux/src/drivers/net/3c509.c (el3_probe): Likewise. * linux/src/drivers/net/3c515.c (init_module): Likewise. (tc515_probe): Likewise. * linux/src/drivers/net/ac3200.c (ac_probe1): Likewise. * linux/src/drivers/net/apricot.c (apricot_probe): Likewise. * linux/src/drivers/net/at1700.c (at1700_probe1): Likewise. * linux/src/drivers/net/de4x5.c (de4x5_hw_init): Likewise. * linux/src/drivers/net/de600.c (de600_probe): Likewise. * linux/src/drivers/net/de620.c (de620_probe): Likewise. * linux/src/drivers/net/depca.c (depca_hw_init): Likewise. * linux/src/drivers/net/e2100.c (e21_probe1): Likewise. * linux/src/drivers/net/eepro.c (eepro_probe1): Likewise. * linux/src/drivers/net/eepro100.c (speedo_found1): Likewise. * linux/src/drivers/net/eexpress.c (eexp_hw_probe): Likewise. * linux/src/drivers/net/ewrk3.c (ewrk3_hw_init): Likewise. * linux/src/drivers/net/fmv18x.c (fmv18x_probe1): Likewise. * linux/src/drivers/net/hp-plus.c (hpp_probe1): Likewise. * linux/src/drivers/net/hp.c (hp_probe1): Likewise. * linux/src/drivers/net/lance.c (lance_probe1): Likewise. * linux/src/drivers/net/ne.c (ne_probe1): Likewise. * linux/src/drivers/net/pcnet32.c (pcnet32_probe1): Likewise. * linux/src/drivers/net/seeq8005.c (seeq8005_probe1): Likewise. * linux/src/drivers/net/smc-ultra.c (ultra_probe1): Likewise. * linux/src/drivers/net/smc-ultra32.c (ultra32_probe1): Likewise. * linux/src/drivers/net/wd.c (wd_probe1): Likewise.
* Add nodma optionsSamuel Thibault2014-11-132-3/+8
| | | | | | | | | | | Some very slow qemu instances would eventually trigger DMA timeouts, let's give a way to disable DMA there, it does not actually slow down operations anyway. * linux/src/drivers/block/ide.h (ide_drive_s): Add nodma field. * linux/src/drivers/block/ide.c (do_identify): Do not call dmaproc(ide_dma_check) when nodma is 1. (ide_setup): Add nodma option.
* Pass ide and hd kernel options to ide driverSamuel Thibault2014-11-122-0/+38
| | | | | | | | | * linux/dev/drivers/block/genhd.c: Include <linux/hdreg.h> and <alloca.h> (device_setup): Look for ide and hd options, and call ide_setup with them. * linux/src/drivers/block/ide.c (ide_setup) [MACH]: Parse hd[0-7] instead of hd[a-h].
* Fix printf warningPietro Braione2014-09-011-1/+1
| | | | | linux/src/drivers/net/sundance.c (start_tx): Fix format string according to parameter.
* Fix prototypeSamuel Thibault2014-04-041-1/+1
| | | | * linux/dev/glue/block.c (device_set_status): Fix prototype.
* Increase possible number of AHCI devices to 8Samuel Thibault2014-03-171-2/+2
| | | | | | | by reducing possible number of partitions to 32. * linux/dev/drivers/block/ahci.c (MAX_PORTS): Set to 8. (PARTN_BITS): Set to 5.
* AHCI driver cleanupsSamuel Thibault2014-02-231-106/+154
| | | | | | | | | | | | | | | * 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.
* Make open return ENXIO on missing CD-ROMSamuel Thibault2014-02-101-0/+4
| | | | | * linux/src/drivers/block/ide-cd.c (ide_cdrom_open): Return -ENXIO when CD sense failed.
* Add quiet flag to CD I/OSamuel Thibault2014-02-101-21/+26
| | | | | | | | | | | | | | | * 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.
* Add missing initializationSamuel Thibault2014-02-101-0/+1
| | | | | * linux/src/drivers/block/ide.c (ide_init_drive_cmd): Initialize `quiet' field of request to 0;
* Add quiet flag to block I/OSamuel Thibault2014-02-105-9/+12
| | | | | | | | | | | | | | 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.
* 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.
* Add files missing in distrib tarballSamuel Thibault2013-09-281-0/+6
| | | | | | | * Makefrag.am (libkernel_a_SOURCES): Add ddb/db_write_cmd.h, ipc/ipc_print.h, vm/vm_print.h * linux/Makefrag.am (EXTRA_DIST): Add linux/src/drivers/scsi/FlashPoint.c, linux/src/drivers/scsi/eata_pio_proc.c, linux/src/drivers/scsi/scsiiom.c.
* Add partitioning reload support to ahciSamuel Thibault2013-06-241-2/+33
| | | | | | | * linux/dev/drivers/block/ahci.c (port): Add `gd' field. (ahci_ioctl): New function. (ahci_fops): Fill `ioctl' field with `ahci_ioctl'. (ahci_probe_pci): Fill `gd' field with `gd'.
* Fix printing ahci PCI dev and funSamuel Thibault2013-06-241-2/+3
| | | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Compute `dev' and `fun' earlier so they can be printed.
* Do not skip AHCI controller without HOST_CAP_ONLYSamuel Thibault2013-06-091-4/+0
| | | | | | | | We rather rely on the announced PCI type to determine whether to use IDE or AHCI. * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Do not skip AHCI controller without HOST_CAP_ONLY.
* Add timeout to ahci IDENTIFYSamuel Thibault2013-06-091-1/+15
| | | | | | * linux/dev/drivers/block/ahci.c (identify_timeout): New function. (identify_timer): New variable. (ahci_probe_port): Add timer to abandon identify command.
* Fix printf formatSamuel Thibault2013-06-091-3/+3
| | | | | | * linux/dev/drivers/block/ahci.c (ahci_do_request): Cast capacity into unsigned long and use %lu format. (ahci_probe_port): Cast size into unsigned and use %u format.
* Fix formatSamuel Thibault2013-06-091-3/+3
|
* Add LBA48 support to AHCI driverSamuel Thibault2013-05-302-12/+41
| | | | | | | | | | | | * linux/dev/drivers/block/ahci.c (port): Extend `capacity' field type to unsigned long long. Add `lba48' field. Make `identify' field unsigned. (ahci_do_port_request): When `lba48' is true, use WIN_READDMA_EXT and WIN_WRITEDMA_EXT commands. (ahci_probe_port): Test lba48 flag, read capacity and set `lba48' accordingly. Display size in GiB above 10GiB. * linux/src/include/linux/hdreg.h (WIN_READDMA_EXT, WIN_WRITEDMA_EXT): New macros (hd_driveid): Add `command_set_2' and lba_capacity_2' fields.
* Add missing parameters to printfSamuel Thibault2013-05-111-1/+1
| | | | | * linux/dev/drivers/block/ahci.c (ahci_probe_dev): Add missing parameters to printf.
* Fix ahci.h pathSamuel Thibault2013-05-101-1/+1
| | | | * linux/Makefrag.am (liblinux_a_SOURCES): Fix path to ahci.h
* Add AHCI driverSamuel Thibault2013-05-107-0/+1136
| | | | | | | | | | | | | * linux/dev/glue/kmem.c (vmtophys): New function. * linux/dev/include/linux/mm.h (vmtophys): New prototype. * linux/src/include/linux/pci.h (PCI_CLASS_STORAGE_SATA, PCI_CLASS_STORAGE_SATA_AHCI): New macros. * linux/dev/drivers/block/ahci.c: New file. * linux/dev/include/ahci.h: New file. * linux/Makefrag.am (liblinux_a_SOURCES): Add linux/dev/drivers/block/ahci.c and linux/dev/drivers/block/ahci.h. * linux/src/drivers/block/ide.c: Include <ahci.h>. (probe_for_hwifs): Call ahci_probe_pci.
* Fix non-block-aligned-offset readsSamuel Thibault2013-05-021-2/+2
| | | | | | | | This fixes grave issues when device_read is called with non-block-aligned offset, e.g. when using grub-probe with a non-block-aligned partition table. * linux/dev/glue/block.c (rdwr_full): Use current position instead of base buffer position to check for alignment.
* Fix macro nameSamuel Thibault2013-05-011-1/+1
| | | | | | * linux/dev/glue/block.c (device_get_status): Use DEV_GET_RECORDS_RECORD_SIZE for DEV_GET_RECORDS instead of DEV_GET_SIZE_RECORD_SIZE.
* Fix slow boot in virtualboxSamuel Thibault2012-12-273-4/+9
| | | | | | | | | | | By disabling some of the most slow drivers by default, and giving progress feedback to the user. * linux/configfrag.ac (CONFIG_SCSI_NCR53C7xx, CONFIG_SCSI_AIC7XXX, CONFIG_SCSI_GDTH): Disable by default * linux/src/drivers/scsi/eata.c (__initfunc): Don't feed line in probe message. * linux/src/drivers/scsi/hosts.c (scsi_init): Print SCSI probe progress.
* Fix spurious error on accessing fd1Samuel Thibault2012-12-271-0/+2
| | | | | | | Cherry picked from Linux kernel commit 76c25284e0d845bff4ee1031721556148af4db1c * linux/dev/drivers/block/floppy.c (config_types): Clear from `allowed_drive_mask' floppy drives whose cmos type is 0.