From 68db26a7abb4619e3127fd30ce7aa27093c69685 Mon Sep 17 00:00:00 2001 From: davidhaas Date: Wed, 12 Feb 2003 16:38:57 +0000 Subject: [PATCH] Made sys_arch_prot() interface more generic by returning sys_prot_t instead of u32_t. --- ports/coldfire/include/arch/sys_arch.h | 1 + ports/coldfire/sys_arch.c | 4 ++-- ports/unix/include/arch/sys_arch.h | 2 ++ ports/unix/sys_arch.c | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ports/coldfire/include/arch/sys_arch.h b/ports/coldfire/include/arch/sys_arch.h index 304d3f6..b0a338d 100644 --- a/ports/coldfire/include/arch/sys_arch.h +++ b/ports/coldfire/include/arch/sys_arch.h @@ -49,6 +49,7 @@ struct timeval { typedef NU_SEMAPHORE * sys_sem_t; typedef NU_QUEUE * sys_mbox_t; typedef NU_TASK * sys_thread_t; +typedef u32_t sys_prot_t; /* Functions specific to Coldfire/Nucleus */ void diff --git a/ports/coldfire/sys_arch.c b/ports/coldfire/sys_arch.c index 611e339..d07336c 100644 --- a/ports/coldfire/sys_arch.c +++ b/ports/coldfire/sys_arch.c @@ -549,7 +549,7 @@ sys_setvect(u32_t vector, void (*isr_function)(void), void (*dis_funct)(void)) } /*---------------------------------------------------------------------------------*/ -u32_t +sys_prot_t sys_arch_protect(void) { return NU_Control_Interrupts(NU_DISABLE_INTERRUPTS); @@ -557,7 +557,7 @@ sys_arch_protect(void) /*---------------------------------------------------------------------------------*/ void -sys_arch_unprotect(u32_t pval) +sys_arch_unprotect(sys_prot_t pval) { NU_Control_Interrupts(pval); } diff --git a/ports/unix/include/arch/sys_arch.h b/ports/unix/include/arch/sys_arch.h index 6c49965..eb0e566 100644 --- a/ports/unix/include/arch/sys_arch.h +++ b/ports/unix/include/arch/sys_arch.h @@ -38,6 +38,8 @@ #define SYS_MBOX_NULL NULL #define SYS_SEM_NULL NULL +typedef u32_t sys_prot_t; + struct sys_sem; typedef struct sys_sem * sys_sem_t; diff --git a/ports/unix/sys_arch.c b/ports/unix/sys_arch.c index a1e034c..d3034bf 100644 --- a/ports/unix/sys_arch.c +++ b/ports/unix/sys_arch.c @@ -455,7 +455,7 @@ sys_arch_timeouts(void) return &thread->timeouts; } /*-----------------------------------------------------------------------------------*/ -u32_t +sys_prot_t sys_arch_protect(void) { /* Note that for the UNIX port, we are using a lightweight mutex, and our @@ -476,7 +476,7 @@ sys_arch_protect(void) } /*-----------------------------------------------------------------------------------*/ void -sys_arch_unprotect(u32_t pval) +sys_arch_unprotect(sys_prot_t pval) { if (lwprot_thread == pthread_self()) {