mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
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
This commit is contained in:
parent
9b8b58e033
commit
4af396a52d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50674
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user