changeset 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
files gsm-fw/gpf/osl/os_isr.c
diffstat 1 files changed, 43 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/gpf/osl/os_isr.c	Wed May 07 19:50:01 2014 +0000
+++ b/gsm-fw/gpf/osl/os_isr.c	Wed May 07 20:18:11 2014 +0000
@@ -24,3 +24,46 @@
 		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);
+}