Project Description

Currently, many devices in FreeBSD's source tree use excessively verbose methods of resource allocation and deallocation. Numerous calls to bus_alloc_resource() or bus_alloc_resource_any() are used to allocate resources, and subsequently, multiple calls to bus_release_resource() are used to free the resources after an error in allocation or when the device is detached.

Recently, however, the bus_alloc_resources() and bus_release_resources() functions have been added. These simple wrappers around bus_alloc_resource_any() and bus_release_resource() both operate on the same resource description, so that much of the repetition once needed to allocate and free resources can be mitigated.

My project is to update driver source code where necessary using the new functions to make the code related to allocation and deallocation simpler and clearer, while making other refinements as needed.

I will patch and test as many drivers as I can during the Summer.

Drivers

Driver

Simplify or Update

Status

Sound driver template

attach, detach, tags/handles, read/write functions

Editing 07/09/07

sys/arm/at91/at91_pio.c

at91_pio_activate/deactivate

Editing 07/07/07

sys/arm/at91/at91_mci.c

activate/deactivate

Editing 07/07/07

sys/arm/at91/at91_rtc.c

activate/deactivate

Editing 07/07/07

sys/arm/at91/at91_spi.c

activate/deactivate

Editing 07/07/07

sys/arm/at91/at91_ssc.c

activate/deactivate

Editing 07/07/07

sys/arm/at91/at91_twi.c

activate/deactivate

Editing 07/07/07

sys/arm/at91/if_ate.c

activate/deactivate

Editing 07/07/07

sys/dev/acpica/acpi_ec.c

attach method, softc (tags/handles), res read/write.

Edited 08/11

sys/dev/aha/aha_isa.c

attach/detach

.

sys/dev/aha/aha_mca.c

attach

.

sys/dev/aic/aic_cbus.c

attach/detach

.

sys/dev/aic/aic_isa.c

attach/detach

.

sys/dev/amr/amr_pci.c

attach/detach

Edited 08/11

sys/dev/sound/pci/als4000.c

tags/handles, read/write functions

Edited 07/31

sys/dev/sound/pci/atiixp.c

attach, release, tags/handles, read/write

Edited 07/31

sys/dev/sound/pci/au88x0.c

attach, detach, tags/handles, read/write

Defunct?

sys/dev/sound/pci/aureal.c

attach, detach, tags/handles, read/write

Defunct?

sys/dev/sound/pci/cmi.c

attach, detach, tags/handles, read/write

Edited 07/26

sys/dev/sound/pci/cs4281.c

tags/handles, read/write functions

Edited 07/31

sys/dev/sound/pci/csa.c

attach, detach, tags/handles, read/write

Edited 07/31

sys/dev/sound/pci/csapcm.c

attach, detach

.

sys/dev/sound/pci/ds1.c

attach/detach, tags/handles, read/write functions

Edited 07/26

sys/dev/sound/pci/emu10k1.c

attach/detach, tags/handles, read/write functions

Edited 07/31

sys/dev/sound/pci/emu10kx.c

attach/detach, tags/handles, read/write functions

Edited 07/31

sys/dev/sound/pci/envy24.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/envy24ht.c

attach/detach, tags/handles, read/write functions

Edited 07/30

sys/dev/sound/pci/es137x.c

attach/detach, tags/handles, read/write functions

Edited 07/26

sys/dev/sound/pci/fm801.c

tags/handles, read/write functions

Edited 07/30

sys/dev/sound/pci/hda/hdac.c

tags/handles

Edited 07/30

sys/dev/sound/pci/hda/hdac_private.h

read/write macros

Edited 07/30

sys/dev/sound/pci/ich.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/maestro3.c

attach/detach, tags/handles, read/write macros

Edited 07/26

sys/dev/sound/pci/maestro.c

attach/detach, tags/handles, read/write functions

Edited 07/26

sys/dev/sound/pci/neomagic.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/solo.c

attach/detach, tags/handles, read/write

Tested

sys/dev/sound/pci/t4dwave.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/via8233.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/via82c686.c

attach/detach, tags/handles, read/write functions

Edited 07/28

sys/dev/sound/pci/vibes.c

attach/detach, tags/handles, read/write functions

Edited 07/31

sys/dev/sound/sbus/cs4231.c

attach/detach, tags/handles, read/write macros

Edited 07/31

sys/dev/sr/

alloc/dealloc, tags/handles, read/write

Edited 08/11

sys/dev/mlx/

alloc/dealloc, tags/handles, read/write

.

sys/dev/lge/

use pci_enable_*, tags/handles, read/write

.

sys/dev/tx/

alloc/dealloc, tags/handles, read/write

.

sys/dev/lmc/

alloc/dealloc, tags/handles, read/write

.

sys/dev/mly/

use pci_enable_*, alloc/dealloc, tags/handles, read/write

.

sys/dev/bce/

alloc/dealloc, tags/handles, read/write

.

sys/dev/bfe/

alloc/dealloc, tags/handles, read/write

.

sys/dev/bge/

alloc/dealloc, tags/handles, read/write

.

sys/dev/bktr/

use pci_enable_* alloc/dealloc, tags/handles, read/write

.

sys/dev/cnw/

alloc/dealloc, tags/handles, read/write

.

BusAllocUpdate (last edited 2008-06-17T21:37:37+0000 by anonymous)