summaryrefslogtreecommitdiffstats
path: root/sys/amd64/amd64/mem.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-08-30 22:13:28 +0000
committermsmith <msmith@FreeBSD.org>1999-08-30 22:13:28 +0000
commit56842578ac635aaac2ea2af6459b06fba2c3a3f1 (patch)
tree845b6d6e24ac8848d22e3d225ddf007778724087 /sys/amd64/amd64/mem.c
parent628be0515eace470ecc5e0055dbc9cee71e2adb9 (diff)
downloadFreeBSD-src-56842578ac635aaac2ea2af6459b06fba2c3a3f1.zip
FreeBSD-src-56842578ac635aaac2ea2af6459b06fba2c3a3f1.tar.gz
Check that there is memory range support before attempting to perform such
an operation, as a kernel client may not have previously checked the CPU type (it may not be able to). Also correct the function declaration style for the mem_range functions to match the rest of this file (oops). Submitted by: gibbs
Diffstat (limited to 'sys/amd64/amd64/mem.c')
-rw-r--r--sys/amd64/amd64/mem.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c
index ab31e70..de134f1 100644
--- a/sys/amd64/amd64/mem.c
+++ b/sys/amd64/amd64/mem.c
@@ -461,8 +461,14 @@ mem_ioctl(dev, cmd, data, flags, p)
* memory range attributes.
*/
void
-mem_range_attr_get(struct mem_range_desc *mrd, int *arg)
+mem_range_attr_get(mrd, arg)
+ struct mem_range_desc *mrd;
+ int *arg;
{
+ /* can we handle this? */
+ if (mem_range_softc.mr_op == NULL)
+ return(EOPNOTSUPP);
+
if (*arg == 0) {
*arg = mem_range_softc.mr_ndesc;
} else {
@@ -471,8 +477,14 @@ mem_range_attr_get(struct mem_range_desc *mrd, int *arg)
}
int
-mem_range_attr_set(struct mem_range_desc *mrd, int *arg)
+mem_range_attr_set(mrd, arg)
+ struct mem_range_desc *mrd;
+ int *arg;
{
+ /* can we handle this? */
+ if (mem_range_softc.mr_op == NULL)
+ return(EOPNOTSUPP);
+
return(mem_range_softc.mr_op->set(&mem_range_softc, mrd, arg));
}
OpenPOWER on IntegriCloud