/*
 * gen-syscall, Tue Jul 21 10:22:52 2026
 *
 * DO NOT EDIT - this file is automatically generated!
 */

/*                                                                      
 * This file belongs to FreeMiNT. It's not in the original MiNT 1.12    
 * distribution. See the file CHANGES for a detailed log of changes.    
 *                                                                      
 *                                                                      
 * Copyright 2000-2005 Frank Naumann <fnaumann@freemint.de>             
 * All rights reserved.                                                 
 *                                                                      
 * Please send suggestions, patches or bug reports to me or             
 * the MiNT mailing list.                                               
 *                                                                      
 *                                                                      
 * This file is free software; you can redistribute it and/or modify    
 * it under the terms of the GNU General Public License as published by 
 * the Free Software Foundation; either version 2, or (at your option)  
 * any later version.                                                   
 *                                                                      
 * This file is distributed in the hope that it will be useful,         
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        
 * GNU General Public License for more details.                         
 *                                                                      
 * You should have received a copy of the GNU General Public License    
 * along with this program; if not, write to the Free Software          
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.            
 *                                                                      
 */                                                                     

#ifndef _MINT_TRAP13_H
#define _MINT_TRAP13_H

#ifndef _COMPILER_H
#include <compiler.h>
#endif

__BEGIN_DECLS

#define trap_13_w(n) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	 \
	__asm__ volatile \
	( \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"addql	#2,sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

#define trap_13_wwl(n,a,b) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	short _a = (short)(a); \
	long _b = (long)(b); \
	 \
	__asm__ volatile \
	( \
		"movl	%3,sp@-\n\t" \
		"movw	%2,sp@-\n\t" \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"addql	#8,sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n), "r"(_a), "r"(_b) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

#define trap_13_wwlwwwl(n,a,b,c,d,e,f) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	short _a = (short)(a); \
	long _b = (long)(b); \
	short _c = (short)(c); \
	short _d = (short)(d); \
	short _e = (short)(e); \
	long _f = (long)(f); \
	 \
	__asm__ volatile \
	( \
		"movl	%7,sp@-\n\t" \
		"movw	%6,sp@-\n\t" \
		"movw	%5,sp@-\n\t" \
		"movw	%4,sp@-\n\t" \
		"movl	%3,sp@-\n\t" \
		"movw	%2,sp@-\n\t" \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"lea	sp@(18),sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n), "r"(_a), "r"(_b), "r"(_c), "r"(_d), "r"(_e), "r"(_f) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

#define trap_13_www(n,a,b) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	short _a = (short)(a); \
	short _b = (short)(b); \
	 \
	__asm__ volatile \
	( \
		"movw	%3,sp@-\n\t" \
		"movw	%2,sp@-\n\t" \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"addql	#6,sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n), "r"(_a), "r"(_b) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

#define trap_13_ww(n,a) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	short _a = (short)(a); \
	 \
	__asm__ volatile \
	( \
		"movw	%2,sp@-\n\t" \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"addql	#4,sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n), "r"(_a) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

#define trap_13_wl(n,a) \
__extension__ \
({ \
	register long retvalue __asm__("d0"); \
	long _a = (long)(a); \
	 \
	__asm__ volatile \
	( \
		"movl	%2,sp@-\n\t" \
		"movw	%1,sp@-\n\t" \
		"trap	#13\n\t" \
		"addql	#6,sp" \
	: "=r"(retvalue) /* outputs */ \
	: "g"(n), "r"(_a) /* inputs  */ \
	: __CLOBBER_RETURN("d0") "d1", "d2", "a0", "a1", "a2" /* clobbered regs */ \
	  AND_MEMORY \
	); \
	retvalue; \
})

__END_DECLS

#endif /* _MINT_TRAP13_H */
