k6_mem.c (69781) | k6_mem.c (103346) |
---|---|
1/*- 2 * Copyright (c) 1999 Brian Fundakowski Feldman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Brian Fundakowski Feldman 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/i386/i386/k6_mem.c 69781 2000-12-08 21:51:06Z dwmalone $ | 26 * $FreeBSD: head/sys/i386/i386/k6_mem.c 103346 2002-09-15 15:07:55Z dwmalone $ |
27 * 28 */ 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/malloc.h> 34#include <sys/memrange.h> --- 39 unchanged lines hidden (view full) --- 74k6_mrmake(struct mem_range_desc *desc, u_int32_t *mtrr) { 75 u_int32_t len = 0, wc, uc; 76 register int bit; 77 78 if (desc->mr_base &~ 0xfffe0000) 79 return EINVAL; 80 if (desc->mr_len < 131072 || !powerof2(desc->mr_len)) 81 return EINVAL; | 27 * 28 */ 29 30#include <sys/param.h> 31#include <sys/kernel.h> 32#include <sys/systm.h> 33#include <sys/malloc.h> 34#include <sys/memrange.h> --- 39 unchanged lines hidden (view full) --- 74k6_mrmake(struct mem_range_desc *desc, u_int32_t *mtrr) { 75 u_int32_t len = 0, wc, uc; 76 register int bit; 77 78 if (desc->mr_base &~ 0xfffe0000) 79 return EINVAL; 80 if (desc->mr_len < 131072 || !powerof2(desc->mr_len)) 81 return EINVAL; |
82 if (desc->mr_flags &~ (MDF_WRITECOMBINE|MDF_UNCACHEABLE)) | 82 if (desc->mr_flags &~ (MDF_WRITECOMBINE|MDF_UNCACHEABLE|MDF_FORCE)) |
83 return EOPNOTSUPP; 84 85 for (bit = ffs(desc->mr_len >> 17) - 1; bit < 15; bit++) 86 len |= 1 << bit; 87 wc = (desc->mr_flags & MDF_WRITECOMBINE) ? 1 : 0; 88 uc = (desc->mr_flags & MDF_UNCACHEABLE) ? 1 : 0; 89 90 *mtrr = K6_REG_MAKE(desc->mr_base, len, wc, uc); --- 94 unchanged lines hidden --- | 83 return EOPNOTSUPP; 84 85 for (bit = ffs(desc->mr_len >> 17) - 1; bit < 15; bit++) 86 len |= 1 << bit; 87 wc = (desc->mr_flags & MDF_WRITECOMBINE) ? 1 : 0; 88 uc = (desc->mr_flags & MDF_UNCACHEABLE) ? 1 : 0; 89 90 *mtrr = K6_REG_MAKE(desc->mr_base, len, wc, uc); --- 94 unchanged lines hidden --- |