cvmx-app-hotplug.h revision 215976
1215976Sjmallett/***********************license start*************** 2215976Sjmallett * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights 3215976Sjmallett * reserved. 4215976Sjmallett * 5215976Sjmallett * 6215976Sjmallett * Redistribution and use in source and binary forms, with or without 7215976Sjmallett * modification, are permitted provided that the following conditions are 8215976Sjmallett * met: 9215976Sjmallett * 10215976Sjmallett * * Redistributions of source code must retain the above copyright 11215976Sjmallett * notice, this list of conditions and the following disclaimer. 12215976Sjmallett * 13215976Sjmallett * * Redistributions in binary form must reproduce the above 14215976Sjmallett * copyright notice, this list of conditions and the following 15215976Sjmallett * disclaimer in the documentation and/or other materials provided 16215976Sjmallett * with the distribution. 17215976Sjmallett 18215976Sjmallett * * Neither the name of Cavium Networks nor the names of 19215976Sjmallett * its contributors may be used to endorse or promote products 20215976Sjmallett * derived from this software without specific prior written 21215976Sjmallett * permission. 22215976Sjmallett 23215976Sjmallett * This Software, including technical data, may be subject to U.S. export control 24215976Sjmallett * laws, including the U.S. Export Administration Act and its associated 25215976Sjmallett * regulations, and may be subject to export or import regulations in other 26215976Sjmallett * countries. 27215976Sjmallett 28215976Sjmallett * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" 29215976Sjmallett * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR 30215976Sjmallett * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO 31215976Sjmallett * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR 32215976Sjmallett * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM 33215976Sjmallett * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE, 34215976Sjmallett * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF 35215976Sjmallett * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR 36215976Sjmallett * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR 37215976Sjmallett * PERFORMANCE OF THE SOFTWARE LIES WITH YOU. 38215976Sjmallett ***********************license end**************************************/ 39215976Sjmallett 40215976Sjmallett/** 41215976Sjmallett * @file 42215976Sjmallett * 43215976Sjmallett * Header file for the hotplug APIs 44215976Sjmallett * 45215976Sjmallett * <hr>$Revision: $<hr> 46215976Sjmallett */ 47215976Sjmallett 48215976Sjmallett#ifndef __CVMX_APP_HOTPLUG_H__ 49215976Sjmallett#define __CVMX_APP_HOTPLUG_H__ 50215976Sjmallett 51215976Sjmallett#ifdef __cplusplus 52215976Sjmallettextern "C" { 53215976Sjmallett#endif 54215976Sjmallett 55215976Sjmallett#ifdef CVMX_BUILD_FOR_LINUX_KERNEL 56215976Sjmallett#include <asm/octeon/cvmx.h> 57215976Sjmallett#include <asm/octeon/cvmx-bootmem.h> 58215976Sjmallett#else 59215976Sjmallett#include "cvmx.h" 60215976Sjmallett#include "cvmx-coremask.h" 61215976Sjmallett#include "cvmx-interrupt.h" 62215976Sjmallett#include "cvmx-bootmem.h" 63215976Sjmallett#endif 64215976Sjmallett 65215976Sjmallett#define CVMX_APP_HOTPLUG_MAX_APPS 32 66215976Sjmallett#define CVMX_APP_HOTPLUG_MAX_APPNAME_LEN 256 67215976Sjmallett 68215976Sjmalletttypedef struct cvmx_app_hotplug_info 69215976Sjmallett{ 70215976Sjmallett char app_name[CVMX_APP_HOTPLUG_MAX_APPNAME_LEN]; 71215976Sjmallett uint32_t coremask; 72215976Sjmallett uint32_t volatile hotplug_activated_coremask; 73215976Sjmallett int32_t valid; 74215976Sjmallett int32_t volatile shutdown_done; 75215976Sjmallett uint64_t shutdown_callback; 76215976Sjmallett uint64_t data; 77215976Sjmallett} cvmx_app_hotplug_info_t; 78215976Sjmallett 79215976Sjmallettstruct cvmx_app_hotplug_global 80215976Sjmallett{ 81215976Sjmallett uint32_t avail_coremask; 82215976Sjmallett cvmx_app_hotplug_info_t hotplug_info_array[CVMX_APP_HOTPLUG_MAX_APPS]; 83215976Sjmallett}; 84215976Sjmallett 85215976Sjmalletttypedef struct cvmx_app_hotplug_global cvmx_app_hotplug_global_t; 86215976Sjmallett 87215976Sjmallettint cvmx_app_hotplug_shutdown_request(uint32_t, int); 88215976Sjmallettcvmx_app_hotplug_info_t* cvmx_app_hotplug_get_info(uint32_t); 89215976Sjmallett#ifndef CVMX_BUILD_FOR_LINUX_USER 90215976Sjmallettint cvmx_app_hotplug_register(void(*)(void*), void*); 91215976Sjmallettint cvmx_app_hotplug_activate(void); 92215976Sjmallettvoid cvmx_app_hotplug_shutdown_disable(void); 93215976Sjmallettvoid cvmx_app_hotplug_shutdown_enable(void); 94215976Sjmallett#endif 95215976Sjmallett 96215976Sjmallett#define CVMX_APP_HOTPLUG_INFO_REGION_SIZE sizeof(cvmx_app_hotplug_global_t) 97215976Sjmallett#define CVMX_APP_HOTPLUG_INFO_REGION_NAME "cvmx-app-hotplug-block" 98215976Sjmallett 99215976Sjmallett#ifdef __cplusplus 100215976Sjmallett} 101215976Sjmallett#endif 102215976Sjmallett 103215976Sjmallett#endif /* __CVMX_APP_HOTPLUG_H__ */ 104