c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * CDDL HEADER START
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab *
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * The contents of this file are subject to the terms of the
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Common Development and Distribution License (the "License").
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * You may not use this file except in compliance with the License.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab *
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * or http://www.opensolaris.org/os/licensing.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * See the License for the specific language governing permissions
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * and limitations under the License.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab *
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * When distributing Covered Code, include this CDDL HEADER in each
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * If applicable, add the following below this CDDL HEADER, with the
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * fields enclosed by brackets "[]" replaced with your own identifying
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * information: Portions Copyright [yyyy] [name of copyright owner]
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab *
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * CDDL HEADER END
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Use is subject to license terms.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#ifndef _SGSRTCID_H
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define _SGSRTCID_H
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#pragma ident "%Z%%M% %I% %E% SMI"
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#ifdef __cplusplus
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0abextern "C" {
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#endif
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * This file defines the Rtc_id structure that is found at the beginning
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * of linker configuration files. It resides at this level so that
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * it can be accessed by file(1) as well as by crle(1) and the
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * runtime linker (ld.so.1). The rest of the data structures for
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * config files are found in usr/src/cmd/sgs/include/rtc.h
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab *
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * The use of sizeof(char) data (no byte order issue) and explicit
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * padding in the definition of Rtc_id ensures that it will have
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * exactly the same layout on all systems, and will have a
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * size of 16 bytes. The same layout means all systems can read it.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * the same size means that any data can be safely placed immediately
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * following it, without the need for alignment.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Identification header.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0abtypedef struct {
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_magic0; /* RTC_ID_MAG0 */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_magic1; /* RTC_ID_MAG1 */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_magic2; /* RTC_ID_MAG2 */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_magic3; /* RTC_ID_MAG0 */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_class; /* File class/capacity (ELFCLASS constant) */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_data; /* Data encoding (ELFDATA constant) */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_machine; /* Architecture (ELF EM_ constant) */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab uchar_t id_pad[9]; /* Ensure size is 16 bytes */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab} Rtc_id;
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define RTC_ID_MAG0 '\077' /* ? */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define RTC_ID_MAG1 'R' /* Runtime */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define RTC_ID_MAG2 'L' /* Linker */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define RTC_ID_MAG3 'C' /* Configuration */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Ensure that the largest machine constant will not grow beyond
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * maximum value representable by an unsigned byte without our
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * being alerted to it.
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#if EM_NUM > 256
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#error "Maximum machine constant size exceeded. Format requires revision."
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#endif
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab/*
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * Check the 4 bytes starting at the given address to see if
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * they contain the Rtc_id magic number. The type of the address
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * is unimportant as long as it is valid, because RTC_ID_TEST()
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab * will cast it to (uchar_t *).
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab */
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#define RTC_ID_TEST(addr) \
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab ((RTC_ID_MAG0 == *((uchar_t *)addr)) && \
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab (RTC_ID_MAG1 == *(((uchar_t *)addr) + 1)) && \
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab (RTC_ID_MAG2 == *(((uchar_t *)addr) + 2)) && \
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab (RTC_ID_MAG3 == *(((uchar_t *)addr) + 3)))
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#ifdef __cplusplus
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab}
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#endif
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab
c13de8f6a88563211bd4432ca11ca38ed3bf0fc0ab#endif /* _SGSRTCID_H */