cmd_page.h revision 600:1e3cb665dd0a
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22/* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27#ifndef _CMD_PAGE_H 28#define _CMD_PAGE_H 29 30#pragma ident "%Z%%M% %I% %E% SMI" 31 32/* 33 * Routines for the creation of page retirement faults and for the management of 34 * page-related state. 35 */ 36 37#include <cmd_state.h> 38#include <cmd_mem.h> 39 40#include <fm/fmd_api.h> 41#include <sys/types.h> 42 43#ifdef __cplusplus 44extern "C" { 45#endif 46 47typedef struct cmd_page { 48 cmd_header_t page_header; /* Nodetype must be CMD_NT_PAGE */ 49 fmd_case_t *page_case; /* Open ret. case against this page */ 50 cmd_fmri_t page_asru; /* ASRU for this page */ 51 uint64_t page_physbase; /* Base phys addr for this page */ 52} cmd_page_t; 53 54#define page_list page_header.hdr_list 55#define page_nodetype page_header.hdr_nodetype 56#define page_bufname page_header.hdr_bufname 57#define page_asru_nvl page_asru.fmri_nvl 58 59/* 60 * Page retirement 61 * 62 * When a page is to be retired, these routines are called to generate and 63 * manage a fault.memory.page against the page. 64 */ 65extern void cmd_page_fault(fmd_hdl_t *, nvlist_t *, nvlist_t *, fmd_event_t *, 66 uint64_t); 67extern void cmd_page_close(fmd_hdl_t *, void *); 68 69extern cmd_page_t *cmd_page_create(fmd_hdl_t *, nvlist_t *, uint64_t); 70extern cmd_page_t *cmd_page_lookup(uint64_t); 71 72extern void *cmd_page_restore(fmd_hdl_t *, fmd_case_t *, cmd_case_ptr_t *); 73extern void cmd_page_validate(fmd_hdl_t *); 74extern void cmd_page_destroy(fmd_hdl_t *, cmd_page_t *); 75extern void cmd_page_fini(fmd_hdl_t *); 76 77#ifdef __cplusplus 78} 79#endif 80 81#endif /* _CMD_PAGE_H */ 82