Subject: Re: mips userland cant compile signal code: _JBLEN not defined
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Castor Fu <castor@geocast.net>
List: port-mips
Date: 01/29/1999 18:17:36
The machine which has the tokens which I need went off net.  I'll
try again some time tonight.  This will give us a chance
to find out what those extra 16 bytes are for.

	-castor

On Fri, 29 Jan 1999, Jonathan Stone wrote:

> Castor is going to commit a cleaned-up version.  Meanwhile, here's the
> mips header files I'm using to prepare for building a snapshot.
> (they're built from genpubassym and the values hand-edited in).
> 
> 
> Btw, the CVS logs say that _JBLEN was bumped from 83 to be 87 in the
> sigcontext rework. But castor computed sizeof(struct sigcontext) as 84.
> Anyone know what's up?  If we're going to keep the value the same
> for binary compatibility, it'd be nice to know what it should be ;).
> 
> 
> 
> 
> # This is a shell archive.  Save it in a file, remove anything before
> # this line, and then unpack it by entering "sh file".  Note, it may
> # create directories; files and directories will be owned by you and
> # have default permissions.
> #
> # This archive contains:
> #
> #	asm.h
> #	setjmp.h
> #
> echo x - asm.h
> sed 's/^X//' >asm.h << 'END-of-asm.h'
> X/*	$NetBSD: asm.h,v 1.15 1999/01/14 18:45:46 castor Exp $	*/
> X
> X/*
> X * Copyright (c) 1992, 1993
> X *	The Regents of the University of California.  All rights reserved.
> X *
> X * This code is derived from software contributed to Berkeley by
> X * Ralph Campbell.
> X *
> X * Redistribution and use in source and binary forms, with or without
> X * modification, are permitted provided that the following conditions
> X * are met:
> X * 1. Redistributions of source code must retain the above copyright
> X *    notice, this list of conditions and the following disclaimer.
> X * 2. Redistributions in binary form must reproduce the above copyright
> X *    notice, this list of conditions and the following disclaimer in the
> X *    documentation and/or other materials provided with the distribution.
> X * 3. All advertising materials mentioning features or use of this software
> X *    must display the following acknowledgement:
> X *	This product includes software developed by the University of
> X *	California, Berkeley and its contributors.
> X * 4. Neither the name of the University nor the names of its contributors
> X *    may be used to endorse or promote products derived from this software
> X *    without specific prior written permission.
> X *
> X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
> X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> X * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
> X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> X * SUCH DAMAGE.
> X *
> X *	@(#)machAsmDefs.h	8.1 (Berkeley) 6/10/93
> X */
> X
> X/*
> X * machAsmDefs.h --
> X *
> X *	Macros used when writing assembler programs.
> X *
> X *	Copyright (C) 1989 Digital Equipment Corporation.
> X *	Permission to use, copy, modify, and distribute this software and
> X *	its documentation for any purpose and without fee is hereby granted,
> X *	provided that the above copyright notice appears in all copies.
> X *	Digital Equipment Corporation makes no representations about the
> X *	suitability of this software for any purpose.  It is provided "as is"
> X *	without express or implied warranty.
> X *
> X * from: Header: /sprite/src/kernel/mach/ds3100.md/RCS/machAsmDefs.h,
> X *	v 1.2 89/08/15 18:28:24 rab Exp  SPRITE (DECWRL)
> X */
> X
> X#ifndef _MIPS_ASM_H
> X#define _MIPS_ASM_H
> X
> X#include <machine/regdef.h>
> X
> X/*
> X * Define -pg profile entry code.
> X * XXX assume .set noreorder for kernel, .set reorder for user code.
> X */
> X#define _KERN_MCOUNT		\
> X	.set	noat;		\
> X	move	$1,$31;		\
> X	jal	_mcount;	\
> X	subu	sp,sp,8;	\
> X	.set at
> X
> X#ifdef GPROF
> X# if defined(_KERNEL) || defined(_LOCORE)
> X#  define MCOUNT _KERN_MCOUNT
> X# else
> X#  define MCOUNT .set noreorder; _KERN_MCOUNT ;  .set reorder;
> X# endif
> X#else
> X#define	MCOUNT
> X#endif
> X
> X#ifdef __NO_LEADING_UNDERSCORES__
> X# define _C_LABEL(x)	x
> X#else
> X# ifdef __STDC__
> X#  define _C_LABEL(x)	_ ## x
> X# else
> X#  define _C_LABEL(x)	_/**/x
> X# endif
> X#endif
> X
> X#ifdef USE_AENT
> X#define AENT(x)				\
> X	.aent	x, 0
> X#else
> X#define AENT(x)
> X#endif
> X
> X/*
> X * WARN_REFERENCES: create a warning if the specified symbol is referenced
> X * (ELF only, and thus, no leading underscores).
> X */
> X#ifdef __ELF__
> X#ifdef __STDC__
> X#define	WARN_REFERENCES(_sym,_msg)				\
> X	.section .gnu.warning. ## _sym ; .ascii _msg ; .text
> X#else
> X#define	WARN_REFERENCES(_sym,_msg)				\
> X	.section .gnu.warning./**/_sym ; .ascii _msg ; .text
> X#endif /* __STDC__ */
> X#endif /* __ELF__ */
> X
> X/*
> X * LEAF
> X *	A leaf routine does
> X *	- call no other function,
> X *	- never use any register that callee-saved (S0-S8), and
> X *	- not use any local stack storage.
> X */
> X#define LEAF(x)				\
> X	.globl	_C_LABEL(x);		\
> X	.ent	_C_LABEL(x), 0;		\
> X_C_LABEL(x): ;				\
> X	.frame sp, 0, ra;		\
> X	MCOUNT
> X
> X/*
> X * LEAF_NOPROFILE
> X *	No profilable leaf routine.
> X */
> X#define LEAF_NOPROFILE(x)		\
> X	.globl	_C_LABEL(x);		\
> X	.ent	_C_LABEL(x), 0;		\
> X_C_LABEL(x): ;				\
> X	.frame	sp, 0, ra
> X
> X/*
> X * XLEAF
> X *	declare alternate entry to leaf routine
> X */
> X#define XLEAF(x)			\
> X	.globl	_C_LABEL(x);		\
> X	.aent	_C_LABEL(x),0;		\
> X_C_LABEL(x):
> X
> X/*
> X * NESTED
> X *	A function calls other functions and needs
> X *	therefore stack space to save/restore registers.
> X */
> X#define NESTED(x, fsize, retpc)		\
> X	.globl	_C_LABEL(x);		\
> X	.ent	_C_LABEL(x), 0; 	\
> X_C_LABEL(x): ;				\
> X	.frame	sp, fsize, retpc;	\
> X	MCOUNT
> X
> X/*
> X * NESTED_NOPROFILE(x)
> X *	No profilable nested routine.
> X */
> X#define NESTED_NOPROFILE(x, fsize, retpc)	\
> X	.globl	_C_LABEL(x);		\
> X	.ent	_C_LABEL(x), 0;		\
> X_C_LABEL(x): ;				\
> X	.frame	sp, fsize, retpc
> X
> X/*
> X * XNESTED
> X *	declare alternate entry point to nested routine.
> X */
> X#define XNESTED(x)			\
> X	.globl	_C_LABEL(x);		\
> X	.aent	_C_LABEL(x),0;		\
> X_C_LABEL(x):
> X
> X/*
> X * END
> X *	Mark end of a procedure.
> X */
> X#define END(x) \
> X	.end _C_LABEL(x)
> X
> X/*
> X * IMPORT -- import external symbol
> X */
> X#define IMPORT(sym, size)		\
> X	.extern sym,size
> X
> X/*
> X * EXPORT -- export definition of symbol
> X */
> X#define EXPORT(x)			\
> X	.globl	_C_LABEL(x);		\
> X_C_LABEL(x):
> X
> X/*
> X * ALIAS
> X *	Global alias for a function, or alternate entry point
> X */
> X#define	ALIAS(x)			\
> X	.globl	_C_LABEL(x);		\
> X_C_LABEL(x):
> X
> X/*
> X * Macros to panic and printf from assembly language.
> X */
> X#define PANIC(msg)			\
> X	la	a0, 9f;			\
> X	jal	_C_LABEL(panic);	\
> X	MSG(msg)
> X
> X#define	PRINTF(msg)			\
> X	la	a0, 9f;			\
> X	jal	_C_LABEL(printf);	\
> X	MSG(msg)
> X
> X#define	MSG(msg)			\
> X	.rdata;				\
> X9:	.asciiz	msg;			\
> X	.text
> X
> X#define ASMSTR(str)			\
> X	.asciiz str;			\
> X	.align	3
> X
> X/*
> X * XXX retain dialects XXX
> X */
> X#define ALEAF(x)			\
> X	.globl _C_LABEL(x);		\
> X	AENT (_C_LABEL(x))		\
> X_C_LABEL(x):
> X
> X#define NLEAF(x)			\
> X	.globl _C_LABEL(x); 		\
> X	.ent _C_LABEL(x), 0;		\
> X_C_LABEL(x): ; \
> X	.frame sp, 0, ra
> X
> X#define NON_LEAF(x, fsize, retpc)	\
> X	.globl _C_LABEL(x);		\
> X	.ent _C_LABEL(x), 0;		\
> X_C_LABEL(x): ;				\
> X	.frame sp, fsize, retpc;	\
> X	MCOUNT
> X
> X#define NNON_LEAF(x, fsize, retpc)	\
> X	.globl _C_LABEL(x);		\
> X	.ent _C_LABEL(x), 0;		\
> X_C_LABEL(x): ;				\
> X	.frame sp, fsize, retpc
> X
> X/*
> X * While it would be nice to be compatible with the SGI 
> X * REG_L and REG_S macros, because they do not take parameters, it
> X * is impossible to use them with the _MIPS_SIM_ABIX32 model.
> X *
> X * These macros hide the use of mips3 instructions from the 
> X * assembler to prevent the assembler from generating 64-bit style
> X * ABI calls.
> X */
> X
> X#if	defined(_MIPS_BSD_SIM) && _MIPS_BSD_SIM_ != _MIPS_SIM_ABI32
> X#define	REG_L	ld
> X#define REG_S	sd
> X#define	REG_LI	dli
> X#define	REG_PROLOGUE	.set push ; .set mips3
> X#define	REG_EPILOGUE	.set pop
> X#define SZREG	8
> X#else
> X#define	REG_L	lw
> X#define REG_S	sw
> X#define	REG_LI	li
> X#define	REG_PROLOGUE	.set push 
> X#define	REG_EPILOGUE	.set pop
> X#define SZREG	4
> X#endif	/* _MIPS_BSD_SIM */
> X
> X#define STAND_FRAME_SIZE	24	/* XXX is this right? */
> X#define STAND_RA_OFFSET		20
> X
> X#define _OFFSETOF_SC_REGS 12
> X#define _OFFSETOF_SC_FPREGS 152
> X#define _OFFSETOF_SC_MASK 320
> X
> X#endif /* _MIPS_ASM_H */
> END-of-asm.h
> echo x - setjmp.h
> sed 's/^X//' >setjmp.h << 'END-of-setjmp.h'
> X/*	$NetBSD: setjmp.h,v 1.4 1999/01/15 03:43:56 castor Exp $	*/
> X
> X/*
> X * mips/setjmp.h: machine dependent setjmp-related information.
> X *
> X * For the size of this, refer to <machine/signal.h> as this uses the 
> X * struct sigcontext to restore it.
> X */
> X
> X#ifndef _JBLEN		/* Size in longs of jmp_buf */
> X# define _JBLEN 87
> X#endif
> END-of-setjmp.h
> exit
>