af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems/*
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * CDDL HEADER START
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems *
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * The contents of this file are subject to the terms of the
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * Common Development and Distribution License (the "License").
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * You may not use this file except in compliance with the License.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems *
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * or http://www.opensolaris.org/os/licensing.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * See the License for the specific language governing permissions
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * and limitations under the License.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems *
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * When distributing Covered Code, include this CDDL HEADER in each
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * If applicable, add the following below this CDDL HEADER, with the
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * fields enclosed by brackets "[]" replaced with your own identifying
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * information: Portions Copyright [yyyy] [name of copyright owner]
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems *
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * CDDL HEADER END
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems */
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems/*
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
14d44f2248cc2a54490db7f7caa4da5968f90837Hans Rosenfeld * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems */
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#ifndef _MBOOT_EXTRA_H
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define _MBOOT_EXTRA_H
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#ifdef __cplusplus
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemsextern "C" {
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#endif
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#include <stdarg.h>
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#include <sys/types.h>
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#include "bblk_einfo.h"
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems/* multiboot header needs to be located in the first 32KB. */
bd94aa560898627952fba8f09dda95c4492e7d9eToomas Soome#define MBOOT_SCAN_SIZE (32 * 1024)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems/* multiboot header AOUT_KLUDGE flag. */
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#define BB_MBOOT_AOUT_FLAG (0x00010000)
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems/* Extra header preceeding the payloads at the end of the bootblock. */
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemstypedef struct _bb_extra_header {
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems uint32_t size;
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems uint32_t checksum;
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems} bb_header_ext_t;
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemsuint32_t compute_checksum(char *, uint32_t);
14d44f2248cc2a54490db7f7caa4da5968f90837Hans Rosenfeldbblk_einfo_t *find_einfo(char *, uint32_t);
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemsint find_multiboot(char *, uint32_t, uint32_t *);
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemsvoid add_einfo(char *, char *, bblk_hs_t *, uint32_t);
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystemsint compare_bootblocks(char *, char *, char **);
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#ifdef __cplusplus
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems}
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#endif
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems
af28f636873b7156cfd73ceffa927658cca33fd0Enrico Perla - Sun Microsystems#endif /* _MBOOT_EXTRA_H */