1*a1bf3f78SToomas Soome /* 2*a1bf3f78SToomas Soome * This file and its contents are supplied under the terms of the 3*a1bf3f78SToomas Soome * Common Development and Distribution License ("CDDL"), version 1.0. 4*a1bf3f78SToomas Soome * You may only use this file in accordance with the terms of version 5*a1bf3f78SToomas Soome * 1.0 of the CDDL. 6*a1bf3f78SToomas Soome * 7*a1bf3f78SToomas Soome * A full copy of the text of the CDDL should have accompanied this 8*a1bf3f78SToomas Soome * source. A copy of the CDDL is also available via the Internet at 9*a1bf3f78SToomas Soome * http://www.illumos.org/license/CDDL. 10*a1bf3f78SToomas Soome */ 11*a1bf3f78SToomas Soome 12*a1bf3f78SToomas Soome /* 13*a1bf3f78SToomas Soome * Copyright 2015 Toomas Soome <tsoome@me.com> 14*a1bf3f78SToomas Soome */ 15*a1bf3f78SToomas Soome 16*a1bf3f78SToomas Soome #ifndef _LOADER_EMU_H 17*a1bf3f78SToomas Soome #define _LOADER_EMU_H 18*a1bf3f78SToomas Soome 19*a1bf3f78SToomas Soome /* 20*a1bf3f78SToomas Soome * BootFORTH emulator interface. 21*a1bf3f78SToomas Soome */ 22*a1bf3f78SToomas Soome 23*a1bf3f78SToomas Soome #ifdef __cplusplus 24*a1bf3f78SToomas Soome extern "C" { 25*a1bf3f78SToomas Soome #endif 26*a1bf3f78SToomas Soome 27*a1bf3f78SToomas Soome /* Commands and return values; nonzero return sets command_errmsg != NULL */ 28*a1bf3f78SToomas Soome typedef int (bootblk_cmd_t)(int argc, char *argv[]); 29*a1bf3f78SToomas Soome extern char *command_errmsg; 30*a1bf3f78SToomas Soome extern char command_errbuf[]; /* XXX blah, length */ 31*a1bf3f78SToomas Soome #define CMD_OK 0 32*a1bf3f78SToomas Soome #define CMD_ERROR 1 33*a1bf3f78SToomas Soome 34*a1bf3f78SToomas Soome /* 35*a1bf3f78SToomas Soome * Support for commands 36*a1bf3f78SToomas Soome */ 37*a1bf3f78SToomas Soome struct bootblk_command 38*a1bf3f78SToomas Soome { 39*a1bf3f78SToomas Soome const char *c_name; 40*a1bf3f78SToomas Soome const char *c_desc; 41*a1bf3f78SToomas Soome bootblk_cmd_t *c_fn; 42*a1bf3f78SToomas Soome STAILQ_ENTRY(bootblk_command) next; 43*a1bf3f78SToomas Soome }; 44*a1bf3f78SToomas Soome 45*a1bf3f78SToomas Soome #ifdef __cplusplus 46*a1bf3f78SToomas Soome } 47*a1bf3f78SToomas Soome #endif 48*a1bf3f78SToomas Soome 49*a1bf3f78SToomas Soome #endif /* _LOADER_EMU_H */ 50