FreeBSD/sys/i386/bios/apm.c
/*
 * return  0 if the function successfull,
 * return  1 if the function unsuccessfull,
 * return -1 if the function unsupported.
 */
return  0 if the function successfull,
return  1 if the function unsuccessfull,
return -1 if the function unsupported.
return 0 if the function successfull return 1 if the function unsuccessfull return - 1 if the function unsupported .
static int
apm_bioscall(void)
{
	struct apm_softc *sc = &apm_softc;
	int errno = 0;
	u_int apm_func = sc->bios.r.eax & 0xff;
	if (!apm_check_function_supported(sc->intversion, apm_func)) {
		APM_DPRINT("apm_bioscall: function 0x%x is not supported in v%d.%d\n",
		    apm_func, sc->majorversion, sc->minorversion);
		return (-1);
	}
	sc->bios_busy = 1;
#ifdef	PC98
	set_bios_selectors(&sc->bios.seg, BIOSCODE_FLAG | BIOSDATA_FLAG);
	if (bios32_apm98(&sc->bios.r, sc->bios.entry,
	    GSEL(GBIOSCODE32_SEL, SEL_KPL)) != 0)
		return 1;
#else
	if (sc->connectmode == APM_PROT32CONNECT) {
		set_bios_selectors(&sc->bios.seg,
				   BIOSCODE_FLAG | BIOSDATA_FLAG);
		errno = bios32(&sc->bios.r,
			       sc->bios.entry, GSEL(GBIOSCODE32_SEL, SEL_KPL));
	} else {
		errno = bios16(&sc->bios, NULL);
	}
#endif
	sc->bios_busy = 0;
	return (errno);
}
static int apm_bioscall ( void ) { struct apm_softc * sc = & apm_softc ; int errno = 0 ; u_int apm_func = sc -> bios . r . eax & 0xff ; if ( ! apm_check_function_supported ( sc -> intversion , apm_func ) ) { APM_DPRINT ( " \n " , apm_func , sc -> majorversion , sc -> minorversion ) ; return ( -1 ) ; } sc -> bios_busy = 1 ; #ifdef PC98 set_bios_selectors ( & sc -> bios . seg , BIOSCODE_FLAG | BIOSDATA_FLAG ) ; if ( bios32_apm98 ( & sc -> bios . r , sc -> bios . entry , GSEL ( GBIOSCODE32_SEL , SEL_KPL ) ) != 0 ) return 1 ; #else if ( sc -> connectmode == APM_PROT32CONNECT ) { set_bios_selectors ( & sc -> bios . seg , BIOSCODE_FLAG | BIOSDATA_FLAG ) ; errno = bios32 ( & sc -> bios . r , sc -> bios . entry , GSEL ( GBIOSCODE32_SEL , SEL_KPL ) ) ; } else { errno = bios16 ( & sc -> bios , NULL ) ; } #endif sc -> bios_busy = 0 ; return ( errno ) ; }
return  0 if the function successfull,
 return  1 if the function unsuccessfull,
 return -1 if the function unsupported.
return 0 if the function successfull return 1 if the function unsuccessfull return - 1 if the function unsupported .