10a6a1f1dSLionel Sambuc/* $NetBSD: sysident.S,v 1.3 2014/05/14 14:59:14 joerg Exp $ */ 2e83f7ba2SBen Gras 3e83f7ba2SBen Gras/* 4e83f7ba2SBen Gras * Copyright (c) 1997 Christopher G. Demetriou 5e83f7ba2SBen Gras * All rights reserved. 6e83f7ba2SBen Gras * 7e83f7ba2SBen Gras * Redistribution and use in source and binary forms, with or without 8e83f7ba2SBen Gras * modification, are permitted provided that the following conditions 9e83f7ba2SBen Gras * are met: 10e83f7ba2SBen Gras * 1. Redistributions of source code must retain the above copyright 11e83f7ba2SBen Gras * notice, this list of conditions and the following disclaimer. 12e83f7ba2SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 13e83f7ba2SBen Gras * notice, this list of conditions and the following disclaimer in the 14e83f7ba2SBen Gras * documentation and/or other materials provided with the distribution. 15e83f7ba2SBen Gras * 3. All advertising materials mentioning features or use of this software 16e83f7ba2SBen Gras * must display the following acknowledgement: 17e83f7ba2SBen Gras * This product includes software developed for the 18e83f7ba2SBen Gras * NetBSD Project. See http://www.NetBSD.org/ for 19e83f7ba2SBen Gras * information about NetBSD. 20e83f7ba2SBen Gras * 4. The name of the author may not be used to endorse or promote products 21e83f7ba2SBen Gras * derived from this software without specific prior written permission. 22e83f7ba2SBen Gras * 23e83f7ba2SBen Gras * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 24e83f7ba2SBen Gras * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25e83f7ba2SBen Gras * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26e83f7ba2SBen Gras * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27e83f7ba2SBen Gras * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28e83f7ba2SBen Gras * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29e83f7ba2SBen Gras * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30e83f7ba2SBen Gras * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31e83f7ba2SBen Gras * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32e83f7ba2SBen Gras * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33e83f7ba2SBen Gras * 34e83f7ba2SBen Gras * <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>> 35e83f7ba2SBen Gras */ 36e83f7ba2SBen Gras 37e83f7ba2SBen Gras/* 38e83f7ba2SBen Gras * Here we define the NetBSD OS Version in an ELF .note section, structured 39e83f7ba2SBen Gras * like: 40e83f7ba2SBen Gras * 41e83f7ba2SBen Gras * [NOTE HEADER] 42e83f7ba2SBen Gras * long name size 43e83f7ba2SBen Gras * long description size 44e83f7ba2SBen Gras * long note type 45e83f7ba2SBen Gras * 46e83f7ba2SBen Gras * [NOTE DATUM] 47e83f7ba2SBen Gras * string OS name 48e83f7ba2SBen Gras * 49e83f7ba2SBen Gras * OSVERSION notes also have: 50e83f7ba2SBen Gras * long OS version (__NetBSD_Version__ constant from param.h) 51e83f7ba2SBen Gras * 52e83f7ba2SBen Gras * The DATUM fields should be padded out such that their actual (not 53e83f7ba2SBen Gras * declared) sizes % 4 == 0. 54e83f7ba2SBen Gras * 55e83f7ba2SBen Gras * These are used by the kernel to determine if this binary is really a 56e83f7ba2SBen Gras * NetBSD binary, or some other OS's. 57e83f7ba2SBen Gras */ 58e83f7ba2SBen Gras 59e83f7ba2SBen Gras#include "sysident_assym.h" 60e83f7ba2SBen Gras 61e83f7ba2SBen Gras .section ".note.netbsd.ident", "a" 6284d9c625SLionel Sambuc .p2align 2 63e83f7ba2SBen Gras 64e83f7ba2SBen Gras .long ELF_NOTE_NETBSD_NAMESZ 65e83f7ba2SBen Gras .long ELF_NOTE_NETBSD_DESCSZ 66e83f7ba2SBen Gras .long ELF_NOTE_TYPE_NETBSD_TAG 67*ace2de0aSLionel Sambuc#if defined(__minix) 68*ace2de0aSLionel Sambuc .ascii "Minix\0\0\0" /* ELF_NOTE_NETBSD_NAME */ 69*ace2de0aSLionel Sambuc .long 300400000 /* Minix version as in "%d%03d%03d", MAJ-MIN-TEENY */ 70*ace2de0aSLionel Sambuc#else 71e83f7ba2SBen Gras .ascii "NetBSD\0\0" /* ELF_NOTE_NETBSD_NAME */ 72e83f7ba2SBen Gras .long __NetBSD_Version__ 7384d9c625SLionel Sambuc#endif /* defined(__minix) */ 74e83f7ba2SBen Gras 75e83f7ba2SBen Gras .section ".note.netbsd.pax", "a" 7684d9c625SLionel Sambuc .p2align 2 77e83f7ba2SBen Gras 78e83f7ba2SBen Gras .long ELF_NOTE_PAX_NAMESZ 79e83f7ba2SBen Gras .long ELF_NOTE_PAX_DESCSZ 80e83f7ba2SBen Gras .long ELF_NOTE_TYPE_PAX_TAG 81e83f7ba2SBen Gras .ascii "PaX\0" /* ELF_NOTE_PAX_NAME */ 82e83f7ba2SBen Gras .long 0 8384d9c625SLionel Sambuc 8484d9c625SLionel Sambuc#ifdef ELF_NOTE_MARCH_DESC 8584d9c625SLionel Sambuc .section ".note.netbsd.march", "a" 8684d9c625SLionel Sambuc .p2align 2 8784d9c625SLionel Sambuc 8884d9c625SLionel Sambuc .long ELF_NOTE_MARCH_NAMESZ 8984d9c625SLionel Sambuc .long ELF_NOTE_MARCH_DESCSZ 9084d9c625SLionel Sambuc .long ELF_NOTE_TYPE_MARCH_TAG 9184d9c625SLionel Sambuc .ascii "NetBSD\0\0" 9284d9c625SLionel Sambuc .asciz ELF_NOTE_MARCH_DESC 930a6a1f1dSLionel Sambuc .p2align 2 94e83f7ba2SBen Gras#endif 95