pg.h revision 0e7515250c8395f368aa45fb9acae7c4f8f8b786
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PG_H
#define _PG_H
/*
* Processor Groups
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <sys/processor.h>
struct pg;
/*
* Nature of CPU relationships
*/
typedef enum pg_relation {
/*
* Processor Group callbacks ops vector
* These provide a mechanism allowing per PG routines to invoked
* in response to events.
*/
typedef struct pg_cb_ops {
kthread_t *);
} pg_cb_ops_t;
/*
* Processor group structure
*/
typedef struct pg {
} pg_t;
/*
* PG class callbacks
*/
struct pg_ops {
void (*cpu_active)(struct cpu *);
void (*cpu_inactive)(struct cpu *);
struct cpupart *);
char *(*policy_name)(struct pg *);
};
#define PG_CLASS_NAME_MAX 32
/*
* PG class structure
*/
typedef struct pg_class {
char pgc_name[PG_CLASS_NAME_MAX];
} pg_class_t;
/*
* Per CPU processor group data
*/
typedef struct cpu_pg {
/* (Group hierarchy ordered) */
} cpu_pg_t;
/*
* PG cpu iterator cookie
*/
typedef struct pg_cpu_itr {
} pg_cpu_itr_t;
/*
* Initialize a PG CPU iterator cookie
*/
{ \
}
/*
* Return the first CPU in a PG
*/
#define PG_CPU_GET_FIRST(pgrp) \
/*
* Return the number of CPUs in a PG
*/
#define PG_NUM_CPUS(pgrp) \
/*
* Framework routines
*/
void pg_init(void);
/*
* PG CPU reconfiguration hooks
*/
void pg_cpu0_init(void);
void pg_cpu_init(cpu_t *);
void pg_cpu_fini(cpu_t *);
void pg_cpu_active(cpu_t *);
void pg_cpu_inactive(cpu_t *);
void pg_cpu_startup(cpu_t *);
void pg_cpu_bootstrap(cpu_t *);
/*
* PG cpupart service hooks
*/
/*
* PG CPU utility routines
*/
void pg_destroy(pg_t *);
/*
* PG Event callbacks
*/
void pg_callback_set_defaults(pg_t *);
/*
* PG Observability interfaces
*/
char *pg_policy_name(pg_t *);
#endif /* !_KERNEL && !_KMEMUSER */
#ifdef __cplusplus
}
#endif
#endif /* _PG_H */