/* Host information structures. Copyright 1999-2002 Johan Rydberg, jrydberg@rtmk.org. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _RTMK_HOST_INFO_H #define _RTMK_HOST_INFO_H 1 /* Flavors. */ #define HOST_INFO_FLAVOR_BASIC 0 #define HOST_INFO_FLAVOR_PROCESSOR 1 /* Basic host information, such as number of processors, available physical memory, page size, and other use full information. */ struct host_info_basic { /* Number of processors that the host supports (ie was configured for). This must not be the same as number of available processors. See AVALABLE_PROCESSORS. */ unsigned int max_processors; /* Number of available processors. Not same as above. */ unsigned int available_processors; /* "Available" physical memory for this host. This is in bytes and not in number of pages. ??? use pages? */ unsigned int physical_memory; /* Page size, in bytes. */ unsigned int page_size; /* Number of configured pages available to the system. */ unsigned int total_pages; /* Number of free pages currently available to the system. */ unsigned int free_pages; /* Generic runtime information about the system; */ unsigned int tasks; /* Number of tasks. */ unsigned int threads; /* Number of threads. */ }; #define HOST_INFO_BASIC_COUNT (sizeof (struct host_info_basic)) typedef struct host_info_basic host_info_basic_t; /* Processor slot information. There is one slot per HOST_INFO_BASIC->CONFIGURED_PROCESSORS. */ struct host_info_processor { unsigned int cpu_type; /* Type of CPU. */ unsigned int cpu_subtype; /* Subtype of CPU. */ unsigned int running_p; /* True if CPU is running. */ unsigned int master_p; /* True if CPU is master. */ #define PROCESSOR_INFO_STATES_MAX 3 #define PROCESSOR_INFO_STATE_IDLE 0 #define PROCESSOR_INFO_STATE_SYSTEM 1 #define PROCESSOR_INFO_STATE_USER 2 unsigned int cpu_ticks [PROCESSOR_INFO_STATES_MAX]; unsigned int clock_freq; /* Clock frequency of CPU. */ }; #define HOST_INFO_PROCESSOR_COUNT (sizeof (struct host_info_basic)) typedef struct host_info_processor host_info_processor_t; #endif /* host-info.h */