view gsm-fw/gpf/osl/os_isr.c @ 347:c9dfa0e20640

OSL reconstruction: os_isr.c: interrupt control functions done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 07 May 2014 20:18:11 +0000
parents fdeea3d6582d
children e63ab4a97e24
line wrap: on
line source

/*
 * This C module is a reconstruction based on the disassembly of
 * os_isr.obj in frame_na7_db_fl.lib from the Leonardo package.
 */

/* set of included headers from COFF symtab: */
#include <string.h>
#include "gpfconf.h"	/* FreeCalypso addition */
#include "../../nucleus/nucleus.h"
#include "typedefs.h"
#include "os.h"
#include "gdi.h"
#include "os_types.h"
#include "os_glob.h"

extern T_OS_OSISR_TABLE_ENTRY OSISRTable[];

GLOBAL LONG
os_isr_init(void)
{
	USHORT i;

	for (i = 1; i <= MaxOSISRs; i++)
		OSISRTable[i].name[0] = 0;
	return(OS_OK);
}

GLOBAL LONG
os_SetInterruptState(OS_INT_STATE new_state, OS_INT_STATE *old_state)
{
	INT state;

	if (new_state)
		state = NU_ENABLE_INTERRUPTS;
	else
		state = NU_DISABLE_INTERRUPTS;
	state = NU_Control_Interrupts(state);
	if (state & 0xFF)
		*old_state = 0;
	else
		*old_state = 1;
	return(OS_OK);
}

GLOBAL LONG
os_EnableInterrupts(OS_INT_STATE *old_state)
{
	INT state;

	state = NU_Control_Interrupts(NU_ENABLE_INTERRUPTS);
	if (state & 0xFF)
		*old_state = 0;
	else
		*old_state = 1;
	return(OS_OK);
}

GLOBAL LONG
os_DisableInterrupts(OS_INT_STATE *old_state)
{
	INT state;

	state = NU_Control_Interrupts(NU_DISABLE_INTERRUPTS);
	if (state & 0xFF)
		*old_state = 0;
	else
		*old_state = 1;
	return(OS_OK);
}