Remove Giant from /dev/mem and /dev/kmem. It is definitely not needed

for i386, and from the code inspection, nothing in the
arm/mips/sparc64 implementations depends on it.

Discussed with:	imp, nwhitehorn
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
This commit is contained in:
Konstantin Belousov 2015-01-24 12:51:15 +00:00
parent 51782e3a89
commit 8f4548ff25
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=277643
5 changed files with 1 additions and 11 deletions

View File

@ -82,8 +82,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
int error = 0;
vm_offset_t addr, eaddr;
GIANT_REQUIRED;
while (uio->uio_resid > 0 && error == 0) {
iov = uio->uio_iov;
if (iov->iov_len == 0) {

View File

@ -52,7 +52,7 @@ static struct cdev *memdev, *kmemdev;
static struct cdevsw mem_cdevsw = {
.d_version = D_VERSION,
.d_flags = D_MEM|D_NEEDGIANT,
.d_flags = D_MEM,
.d_open = memopen,
.d_read = memrw,
.d_write = memrw,

View File

@ -86,10 +86,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
int error = 0;
vm_offset_t addr;
/* XXX UPS Why ? */
GIANT_REQUIRED;
if (dev2unit(dev) != CDEV_MINOR_MEM && dev2unit(dev) != CDEV_MINOR_KMEM)
return EIO;

View File

@ -85,8 +85,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
cnt = 0;
error = 0;
GIANT_REQUIRED;
pmap_page_init(&m);
while (uio->uio_resid > 0 && !error) {
iov = uio->uio_iov;

View File

@ -99,8 +99,6 @@ memrw(struct cdev *dev, struct uio *uio, int flags)
error = 0;
ova = 0;
GIANT_REQUIRED;
while (uio->uio_resid > 0 && error == 0) {
iov = uio->uio_iov;
if (iov->iov_len == 0) {