From 159b63701539f3e584668a4ace13c6109d3b364b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 3 May 2016 06:47:21 +0200 Subject: bsp/mvme5500: Use thread local variable Use thread local variable instead of task variable. Update #2494. --- .../powerpc/mvme5500/vectors/exceptionhandler.c | 27 ++++------------------ 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'c') diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c index bb3cbf604f..f8f124ee46 100644 --- a/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c +++ b/c/src/lib/libbsp/powerpc/mvme5500/vectors/exceptionhandler.c @@ -53,28 +53,19 @@ #include #include #include +#include #include #define SRR1_TEA_EXC (1<<(31-13)) #define SRR1_MCP_EXC (1<<(31-12)) -static volatile BSP_ExceptionExtension BSP_exceptionExtension = 0; - -/* - * We know task variables are deprecated and don't want a warning. The - * use of task variables needs to be fixed in this file. - */ -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +static thread_local volatile BSP_ExceptionExtension BSP_exceptionExtension = 0; BSP_ExceptionExtension BSP_exceptionHandlerInstall(BSP_ExceptionExtension e) { volatile BSP_ExceptionExtension test; - if ( RTEMS_SUCCESSFUL != rtems_task_variable_get(RTEMS_SELF, (void*)&BSP_exceptionExtension, (void**)&test) ) { - /* not yet added */ - rtems_task_variable_add(RTEMS_SELF, (void*)&BSP_exceptionExtension, 0); - } test = BSP_exceptionExtension; BSP_exceptionExtension = e; return test; @@ -100,18 +91,8 @@ int quiet=0; fmt="Aieeh, Exception %d in initialization code\n"; } else { /* retrieve the notepad which possibly holds an extention pointer */ - if (RTEMS_SUCCESSFUL==rtems_task_ident(RTEMS_SELF,RTEMS_LOCAL,&id) && -// FIXME: Deprecated use of Notepads. #2503. -#if 0 -/* Must not use a notepad due to unknown initial value (notepad memory is allocated from the - * workspace)! - */ - RTEMS_SUCCESSFUL==rtems_task_get_note(id, BSP_EXCEPTION_NOTEPAD, ¬e) -#else - RTEMS_SUCCESSFUL==rtems_task_variable_get(id, (void*)&BSP_exceptionExtension, (void**)¬e) -#endif - ) { - ext = (BSP_ExceptionExtension)note; + if (RTEMS_SUCCESSFUL==rtems_task_ident(RTEMS_SELF,RTEMS_LOCAL,&id)) { + ext = BSP_exceptionExtension; if (ext) quiet=ext->quiet; if (!quiet) { -- cgit v1.2.3