mem.c (108331) | mem.c (109623) |
---|---|
1/*- 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department, and code derived from software contributed to --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: Utah $Hdr: mem.c 1.13 89/10/08$ 40 * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 41 * from: FreeBSD: src/sys/i386/i386/mem.c,v 1.94 2001/09/26 42 * | 1/*- 2 * Copyright (c) 1988 University of Utah. 3 * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department, and code derived from software contributed to --- 26 unchanged lines hidden (view full) --- 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37 * SUCH DAMAGE. 38 * 39 * from: Utah $Hdr: mem.c 1.13 89/10/08$ 40 * from: @(#)mem.c 7.2 (Berkeley) 5/9/91 41 * from: FreeBSD: src/sys/i386/i386/mem.c,v 1.94 2001/09/26 42 * |
43 * $FreeBSD: head/sys/sparc64/sparc64/mem.c 108331 2002-12-27 19:18:04Z jake $ | 43 * $FreeBSD: head/sys/sparc64/sparc64/mem.c 109623 2003-01-21 08:56:16Z alfred $ |
44 */ 45 46/* 47 * Memory special file 48 * 49 * NOTE: other architectures support mmap()'ing the mem and kmem devices; this 50 * might cause illegal aliases to be created for the locked kernel page(s), so 51 * it is not implemented. --- 93 unchanged lines hidden (view full) --- 145 if (uio->uio_iovcnt < 0) 146 panic("mmrw"); 147 continue; 148 } 149 switch (minor(dev)) { 150 case 0: 151 /* mem (physical memory) */ 152 if (buf == NULL) { | 44 */ 45 46/* 47 * Memory special file 48 * 49 * NOTE: other architectures support mmap()'ing the mem and kmem devices; this 50 * might cause illegal aliases to be created for the locked kernel page(s), so 51 * it is not implemented. --- 93 unchanged lines hidden (view full) --- 145 if (uio->uio_iovcnt < 0) 146 panic("mmrw"); 147 continue; 148 } 149 switch (minor(dev)) { 150 case 0: 151 /* mem (physical memory) */ 152 if (buf == NULL) { |
153 buf = malloc(PAGE_SIZE, M_DEVBUF, M_WAITOK); | 153 buf = malloc(PAGE_SIZE, M_DEVBUF, 0); |
154 if (buf == NULL) { 155 error = ENOMEM; 156 break; 157 } 158 } 159 v = uio->uio_offset; 160 asi = ASI_PHYS_USE_EC; 161 /* Access device memory noncacheable. */ --- 84 unchanged lines hidden --- | 154 if (buf == NULL) { 155 error = ENOMEM; 156 break; 157 } 158 } 159 v = uio->uio_offset; 160 asi = ASI_PHYS_USE_EC; 161 /* Access device memory noncacheable. */ --- 84 unchanged lines hidden --- |