aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorAttilio Rao <attilio@FreeBSD.org>2009-08-02 14:28:40 +0000
committerAttilio Rao <attilio@FreeBSD.org>2009-08-02 14:28:40 +0000
commit444b91868b5294e3a2151fffa3b063763a562448 (patch)
treec00d808d1df8000c2086c86613be9ec8536a5e28 /sys/sys/bus.h
parentd40b91cb1354e9bae491567cc88c215eda16d649 (diff)
downloadsrc-444b91868b5294e3a2151fffa3b063763a562448.tar.gz
src-444b91868b5294e3a2151fffa3b063763a562448.zip
Make the newbus subsystem Giant free by adding the new newbus sxlock.
The newbus lock is responsible for protecting newbus internIal structures, device states and devclass flags. It is necessary to hold it when all such datas are accessed. For the other operations, softc locking should ensure enough protection to avoid races. Newbus lock is automatically held when virtual operations on the device and bus are invoked when loading the driver or when the suspend/resume take place. For other 'spourious' operations trying to access/modify the newbus topology, newbus lock needs to be automatically acquired and dropped. For the moment Giant is also acquired in some key point (modules subsystem) in order to avoid problems before the 8.0 release as module handlers could make assumptions about it. This Giant locking should go just after the release happens. Please keep in mind that the public interface can be expanded in order to provide more support, if there are really necessities at some point and also some bugs could arise as long as the patch needs a bit of further testing. Bump __FreeBSD_version in order to reflect the newbus lock introduction. Reviewed by: ed, hps, jhb, imp, mav, scottl No answer by: ariff, thompsa, yongari Tested by: pho, G. Trematerra <giovanni dot trematerra at gmail dot com>, Brandon Gooch <jamesbrandongooch at gmail dot com> Sponsored by: Yahoo! Incorporated Approved by: re (ksmith)
Notes
Notes: svn path=/head/; revision=196037
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 2362041dad26..7ed06f4fed91 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -478,6 +478,14 @@ int resource_set_string(const char *name, int unit, const char *resname,
int bus_data_generation_check(int generation);
void bus_data_generation_update(void);
+/*
+ * Exported locking facilities.
+ */
+void newbus_xlock(void);
+void newbus_slock(void);
+void newbus_xunlock(void);
+void newbus_sunlock(void);
+
/**
* Some convenience defines for probe routines to return. These are just
* suggested values, and there's nothing magical about them.