137904Sjlemon/*-
237904Sjlemon * Copyright (c) 1998 Jonathan Lemon
337904Sjlemon * All rights reserved.
437904Sjlemon *
537904Sjlemon * Redistribution and use in source and binary forms, with or without
637904Sjlemon * modification, are permitted provided that the following conditions
737904Sjlemon * are met:
837904Sjlemon * 1. Redistributions of source code must retain the above copyright
937904Sjlemon *    notice, this list of conditions and the following disclaimer.
1037904Sjlemon * 2. Redistributions in binary form must reproduce the above copyright
1137904Sjlemon *    notice, this list of conditions and the following disclaimer in the
1237904Sjlemon *    documentation and/or other materials provided with the distribution.
1337904Sjlemon *
1437904Sjlemon * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1537904Sjlemon * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1637904Sjlemon * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1737904Sjlemon * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1837904Sjlemon * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1937904Sjlemon * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2037904Sjlemon * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2137904Sjlemon * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2237904Sjlemon * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2337904Sjlemon * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2437904Sjlemon * SUCH DAMAGE.
2537904Sjlemon */
2637904Sjlemon
2792986Sobrien#include <sys/cdefs.h>
2892986Sobrien__FBSDID("$FreeBSD$");
2937904Sjlemon
3037904Sjlemon#include <machine/sysarch.h>
3137904Sjlemon
3237904Sjlemonint
3337917Sjlemoni386_get_ioperm(unsigned int start, unsigned int *length, int *enable)
3437904Sjlemon{
3550817Sluoqi	struct i386_ioperm_args p;
3637904Sjlemon	int error;
3737904Sjlemon
3837904Sjlemon	p.start = start;
3937904Sjlemon	p.length = *length;
4037904Sjlemon	p.enable = *enable;
4137904Sjlemon
42124296Snectar	error = sysarch(I386_GET_IOPERM, &p);
4337904Sjlemon
4437904Sjlemon	*length = p.length;
4537904Sjlemon	*enable = p.enable;
4637904Sjlemon
4737904Sjlemon	return (error);
4837904Sjlemon}
49