Annotation of kernel/machdep/i386/pmon.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /*
                     26:  * pmon.h - structs and #defines for performance monitor library interfaces.
                     27:  *
                     28:  * History
                     29:  * -------
                     30:  * 18-Dec-89   dmitch
                     31:  *     Created.
                     32:  */
                     33:  
                     34: #import        <sys/types.h>
                     35: #import        <sys/message.h>
                     36: #import <machine/pmon_ipc.h>
                     37: #import <sys/boolean.h>
                     38: 
                     39: /* 
                     40:  *     pmon_vars struct. One per client, initialized in pmon_open().
                     41:  */
                     42: struct pmon_vars {
                     43:        
                     44:        port_t          server_port;    /* pmon server's port */
                     45:        port_t          reply_port;     /* port thru which we communicate with
                     46:                                         * pmon server */
                     47:        port_t          event_port;     /* port to which events are sent */
                     48:        pmon_event_msg_t emsg;          /* contains the last event message 
                     49:                                         * received in event_port */
                     50:        pmon_event_t    event_ptr;      /* points to an element in 
                     51:                                         * emsg->event[], or NULL if no valid 
                     52:                                         * events. */
                     53:        int             num_events;     /* number of valid, unused pmon_events
                     54:                                         * in emsg */
                     55: }; 
                     56: 
                     57: typedef struct pmon_vars *pmon_vars_t;
                     58: 
                     59: typedef int            pmon_return_t;
                     60: 
                     61: /*
                     62:  *     values for pmon_return_t
                     63:  */
                     64: #define PMR_SUCCESS       0            /* OK */
                     65: #define PMR_RESOURCE   -900            /* resource (memory, port) allocation
                     66:                                         * failure */
                     67: #define PMR_IPCFAIL    -901            /* mach IPC error */
                     68: #define PMR_ACCESS     -902            /* desired events already destined for
                     69:                                         * another viewer */
                     70: #define PMR_BADEVENT   -903            /* bad source/event */
                     71: #define PMR_SERVCONN   -904            /* couldn't connect to server */
                     72: #define PMR_BADMSG     -905            /* bad message */
                     73: #define PMR_QUEUEFULL  -906            /* destination queue full on
                     74:                                         * msg_send() */
                     75: #define PMR_BADPARAM   -907            /* bad parameter */
                     76: #define PMR_INTERNAL   -908            /* pmon internal error */
                     77: #define PMR_TARGCONN   -909            /* couldn't connect to client */
                     78: #define PMR_DISCONN    -910            /* not connected to specified
                     79:                                         *  source/event_type */
                     80: #define PMR_BADSTATUS    -1            /* not used */
                     81: 
                     82: /*
                     83:  *     prototypes for library functions
                     84:  */
                     85:  
                     86: /*
                     87:  * client library functions
                     88:  */
                     89: pmon_return_t pmon_open(char *hostname, 
                     90:                pmon_vars_t *pvpp);
                     91: pmon_return_t pmon_target_cntrl(pmon_vars_t pvp,
                     92:                char *hostname,
                     93:                char *devname,
                     94:                int source,
                     95:                int msg_id,
                     96:                int event_type);
                     97: pmon_return_t pmon_connect(pmon_vars_t pvp,
                     98:                int source,     
                     99:                int event_type);
                    100: pmon_return_t pmon_disconnect(pmon_vars_t pvp,
                    101:                int source,
                    102:                int event_type);
                    103: void pmon_close(pmon_vars_t pvp);
                    104: pmon_return_t pmon_get_event(pmon_vars_t pvp,
                    105:                pmon_event_t event_p);
                    106: void pmon_error(char *err_str, pmon_return_t err);
                    107: 
                    108: /* 
                    109:  * target library functions
                    110:  */
                    111: void pmon_build_emsg(pmon_event_msg_t msgp,
                    112:                port_t local_port,
                    113:                port_t server_port);
                    114: int pmon_add_event(pmon_event_msg_t msgp,
                    115:                pmon_event_t ep,
                    116:                boolean_t send);
                    117: pmon_return_t pmon_send_emsg(pmon_event_msg_t msgp);
                    118: 
                    119: /* end of pmon.h */
                    120: 
                    121: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.