1 /***********************license start***************
2 * Copyright (c) 2003-2010 Cavium Networks (support@cavium.com). All rights
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials provided
16 * with the distribution.
18 * * Neither the name of Cavium Networks nor the names of
19 * its contributors may be used to endorse or promote products
20 * derived from this software without specific prior written
23 * This Software, including technical data, may be subject to U.S. export control
24 * laws, including the U.S. Export Administration Act and its associated
25 * regulations, and may be subject to export or import regulations in other
28 * TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS"
29 * AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROMISES, REPRESENTATIONS OR
30 * WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH RESPECT TO
31 * THE SOFTWARE, INCLUDING ITS CONDITION, ITS CONFORMITY TO ANY REPRESENTATION OR
32 * DESCRIPTION, OR THE EXISTENCE OF ANY LATENT OR PATENT DEFECTS, AND CAVIUM
33 * SPECIFICALLY DISCLAIMS ALL IMPLIED (IF ANY) WARRANTIES OF TITLE,
34 * MERCHANTABILITY, NONINFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, LACK OF
35 * VIRUSES, ACCURACY OR COMPLETENESS, QUIET ENJOYMENT, QUIET POSSESSION OR
36 * CORRESPONDENCE TO DESCRIPTION. THE ENTIRE RISK ARISING OUT OF USE OR
37 * PERFORMANCE OF THE SOFTWARE LIES WITH YOU.
38 ***********************license end**************************************/
43 * Header file for the hotplug APIs
45 * <hr>$Revision: $<hr>
48 #ifndef __CVMX_APP_HOTPLUG_H__
49 #define __CVMX_APP_HOTPLUG_H__
55 #ifdef CVMX_BUILD_FOR_LINUX_KERNEL
56 #include <asm/octeon/cvmx.h>
57 #include <asm/octeon/cvmx-bootmem.h>
60 #include "cvmx-coremask.h"
61 #include "cvmx-interrupt.h"
62 #include "cvmx-bootmem.h"
65 #define CVMX_APP_HOTPLUG_MAX_APPS 32
66 #define CVMX_APP_HOTPLUG_MAX_APPNAME_LEN 256
68 typedef struct cvmx_app_hotplug_info
70 char app_name[CVMX_APP_HOTPLUG_MAX_APPNAME_LEN];
72 uint32_t volatile hotplug_activated_coremask;
74 int32_t volatile shutdown_done;
75 uint64_t shutdown_callback;
77 } cvmx_app_hotplug_info_t;
79 struct cvmx_app_hotplug_global
81 uint32_t avail_coremask;
82 cvmx_app_hotplug_info_t hotplug_info_array[CVMX_APP_HOTPLUG_MAX_APPS];
85 typedef struct cvmx_app_hotplug_global cvmx_app_hotplug_global_t;
87 int cvmx_app_hotplug_shutdown_request(uint32_t, int);
88 cvmx_app_hotplug_info_t* cvmx_app_hotplug_get_info(uint32_t);
89 #ifndef CVMX_BUILD_FOR_LINUX_USER
90 int cvmx_app_hotplug_register(void(*)(void*), void*);
91 int cvmx_app_hotplug_activate(void);
92 void cvmx_app_hotplug_shutdown_disable(void);
93 void cvmx_app_hotplug_shutdown_enable(void);
96 #define CVMX_APP_HOTPLUG_INFO_REGION_SIZE sizeof(cvmx_app_hotplug_global_t)
97 #define CVMX_APP_HOTPLUG_INFO_REGION_NAME "cvmx-app-hotplug-block"
103 #endif /* __CVMX_APP_HOTPLUG_H__ */