mca.c (107205) | mca.c (109623) |
---|---|
1/* 2 * Copyright (c) 2002 Marcel Moolenaar 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 * --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * | 1/* 2 * Copyright (c) 2002 Marcel Moolenaar 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 * --- 9 unchanged lines hidden (view full) --- 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/ia64/ia64/mca.c 107205 2002-11-24 20:07:23Z marcel $ | 26 * $FreeBSD: head/sys/ia64/ia64/mca.c 109623 2003-01-21 08:56:16Z alfred $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/lock.h> 33#include <sys/malloc.h> 34#include <sys/mutex.h> --- 69 unchanged lines hidden (view full) --- 104 105 hdr = (struct mca_record_header *)mca_info_block; 106 recsz = hdr->rh_length; 107 seqnr = hdr->rh_seqnr; 108 109 mtx_unlock_spin(&mca_info_block_lock); 110 111 totsz = sizeof(struct sysctl_oid) + recsz + 32; | 27 */ 28 29#include <sys/param.h> 30#include <sys/systm.h> 31#include <sys/kernel.h> 32#include <sys/lock.h> 33#include <sys/malloc.h> 34#include <sys/mutex.h> --- 69 unchanged lines hidden (view full) --- 104 105 hdr = (struct mca_record_header *)mca_info_block; 106 recsz = hdr->rh_length; 107 seqnr = hdr->rh_seqnr; 108 109 mtx_unlock_spin(&mca_info_block_lock); 110 111 totsz = sizeof(struct sysctl_oid) + recsz + 32; |
112 oidp = malloc(totsz, M_MCA, M_WAITOK|M_ZERO); | 112 oidp = malloc(totsz, M_MCA, M_ZERO); |
113 state = (char*)(oidp + 1); 114 name = state + recsz; 115 sprintf(name, "%lld", (long long)seqnr); 116 117 mtx_lock_spin(&mca_info_block_lock); 118 119 /* 120 * If the info block doesn't have our record anymore because --- 72 unchanged lines hidden (view full) --- 193 mca_info_size[i] = result.sal_result[0]; 194 if (mca_info_size[i] > max_size) 195 max_size = mca_info_size[i]; 196 } else 197 mca_info_size[i] = -1; 198 } 199 max_size = round_page(max_size); 200 | 113 state = (char*)(oidp + 1); 114 name = state + recsz; 115 sprintf(name, "%lld", (long long)seqnr); 116 117 mtx_lock_spin(&mca_info_block_lock); 118 119 /* 120 * If the info block doesn't have our record anymore because --- 72 unchanged lines hidden (view full) --- 193 mca_info_size[i] = result.sal_result[0]; 194 if (mca_info_size[i] > max_size) 195 max_size = mca_info_size[i]; 196 } else 197 mca_info_size[i] = -1; 198 } 199 max_size = round_page(max_size); 200 |
201 p = contigmalloc(max_size, M_TEMP, M_WAITOK, 0ul, 256*1024*1024 - 1, | 201 p = contigmalloc(max_size, M_TEMP, 0, 0ul, 256*1024*1024 - 1, |
202 PAGE_SIZE, 256*1024*1024); 203 204 mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p)); 205 206 if (bootverbose) 207 printf("MCA: allocated %ld bytes for state information\n", 208 max_size); 209 --- 18 unchanged lines hidden --- | 202 PAGE_SIZE, 256*1024*1024); 203 204 mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p)); 205 206 if (bootverbose) 207 printf("MCA: allocated %ld bytes for state information\n", 208 max_size); 209 --- 18 unchanged lines hidden --- |