Blame sysdeps/sun4/glibtop_machine.h

Packit Service 407539
/* Copyright (C) 1998-99 Martin Baulig
Packit Service 407539
   This file is part of LibGTop 1.0.
Packit Service 407539
Packit Service 407539
   Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
Packit Service 407539
Packit Service 407539
   LibGTop is free software; you can redistribute it and/or modify it
Packit Service 407539
   under the terms of the GNU General Public License as published by
Packit Service 407539
   the Free Software Foundation; either version 2 of the License,
Packit Service 407539
   or (at your option) any later version.
Packit Service 407539
Packit Service 407539
   LibGTop is distributed in the hope that it will be useful, but WITHOUT
Packit Service 407539
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
Packit Service 407539
   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
Packit Service 407539
   for more details.
Packit Service 407539
Packit Service 407539
   You should have received a copy of the GNU General Public License
Packit Service 407539
   along with LibGTop; see the file COPYING. If not, write to the
Packit Service 407539
   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit Service 407539
   Boston, MA 02110-1301, USA.
Packit Service 407539
*/
Packit Service 407539
Packit Service 407539
#ifndef __GLIBTOP_MACHINE_H__
Packit Service 407539
#define __GLIBTOP_MACHINE_H__
Packit Service 407539
Packit Service 407539
/* make sure param.h gets loaded with KERNEL defined to get PZERO & NZERO */
Packit Service 407539
#define KERNEL
Packit Service 407539
#include <sys/param.h>
Packit Service 407539
#undef KERNEL
Packit Service 407539
Packit Service 407539
#include <stdio.h>
Packit Service 407539
#include <kvm.h>
Packit Service 407539
#include <nlist.h>
Packit Service 407539
#include <math.h>
Packit Service 407539
#include <sys/dir.h>
Packit Service 407539
#include <sys/user.h>
Packit Service 407539
#include <sys/proc.h>
Packit Service 407539
#include <sys/dk.h>
Packit Service 407539
#include <sys/vm.h>
Packit Service 407539
#include <sys/file.h>
Packit Service 407539
#include <sys/time.h>
Packit Service 407539
#include <vm/page.h>
Packit Service 407539
Packit Service 407539
#ifdef solbourne
Packit Service 407539
#include <sys/syscall.h>
Packit Service 407539
#endif
Packit Service 407539
Packit Service 407539
#include "loadavg.h"
Packit Service 407539
Packit Service 407539
G_BEGIN_DECLS
Packit Service 407539
Packit Service 407539
/* Older versions of SunOS don't have a typedef for pid_t.
Packit Service 407539
   Hopefully this will catch all those cases without causing other problems.
Packit Service 407539
 */
Packit Service 407539
#ifndef __sys_stdtypes_h
Packit Service 407539
typedef int pid_t;
Packit Service 407539
#endif
Packit Service 407539
Packit Service 407539
/* definitions for indices in the nlist array */
Packit Service 407539
#define X_AVENRUN	0
Packit Service 407539
#define X_CCPU		1
Packit Service 407539
#define X_MPID		2
Packit Service 407539
#define X_NPROC		3
Packit Service 407539
#define X_PROC		4
Packit Service 407539
#define X_TOTAL		5
Packit Service 407539
#define X_CP_TIME	6
Packit Service 407539
#define X_PAGES		7
Packit Service 407539
#define X_EPAGES	8
Packit Service 407539
#define X_SHMINFO	9
Packit Service 407539
#define X_MSGINFO	10
Packit Service 407539
#define X_SEMINFO	11
Packit Service 407539
Packit Service 407539
#ifdef MULTIPROCESSOR
Packit Service 407539
#define X_NCPU		12
Packit Service 407539
#define X_MP_TIME	13
Packit Service 407539
#endif
Packit Service 407539
Packit Service 407539
/* Log base 2 of 1024 is 10 (2^10 == 1024) */
Packit Service 407539
#define LOG1024         10
Packit Service 407539
Packit Service 407539
typedef struct _glibtop_machine		glibtop_machine;
Packit Service 407539
Packit Service 407539
struct _glibtop_machine
Packit Service 407539
{
Packit Service 407539
	uid_t uid, euid;		/* Real and effective user id */
Packit Service 407539
	gid_t gid, egid;		/* Real and effective group id */
Packit Service 407539
	int nlist_count;		/* Number of symbols in the nlist */
Packit Service 407539
	int ncpu;			/* Number of CPUs we have */
Packit Service 407539
	int nproc;			/* Number of entries in the process array */
Packit Service 407539
	size_t ptable_size;		/* Size of process array. */
Packit Service 407539
	unsigned long ptable_offset;	/* Offset of process array in kernel. */
Packit Service 407539
	struct proc *proc_table;	/* Process array. */
Packit Service 407539
	unsigned long pages, epages;
Packit Service 407539
	struct page *physpage;
Packit Service 407539
	int bytesize, count;
Packit Service 407539
	int pageshift;			/* log base 2 of the pagesize */
Packit Service 407539
	kvm_t *kd;
Packit Service 407539
};
Packit Service 407539
Packit Service 407539
/* Those functions are used internally in libgtop */
Packit Service 407539
Packit Service 407539
#ifdef _IN_LIBGTOP
Packit Service 407539
Packit Service 407539
extern struct nlist _glibtop_nlist[];
Packit Service 407539
Packit Service 407539
int _glibtop_check_nlist (void *server, register struct nlist *nlst);
Packit Service 407539
int _glibtop_getkval (void *void_server, unsigned long offset, int *ptr,
Packit Service 407539
		      int size, char *refstr);
Packit Service 407539
void _glibtop_read_proc_table (void *void_server);
Packit Service 407539
struct proc *_glibtop_find_pid (void *void_server, pid_t pid);
Packit Service 407539
Packit Service 407539
#endif
Packit Service 407539
Packit Service 407539
G_END_DECLS
Packit Service 407539
Packit Service 407539
#endif