1
0
mirror of https://github.com/adtools/clib2.git synced 2026-05-06 13:16:22 +00:00

- Switched over the startup code and the library itself to use

constructor/destructor functions for initialization and cleanup
  purposes.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14882 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-11 13:23:18 +00:00
parent 86b7e5c429
commit f289140266
21 changed files with 129 additions and 201 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: stdlib_stackextension.c,v 1.7 2005-03-11 09:37:29 obarthel Exp $
* $Id: stdlib_stackextension.c,v 1.8 2005-03-11 13:23:18 obarthel Exp $
*
* :ts=4
*
@@ -282,13 +282,10 @@ ULONG __stk_size;
/****************************************************************************/
int
__stk_init(void)
STK_CONSTRUCTOR(__stk_init)
{
struct Task *task = FindTask(NULL);
ENTER();
__stk_initial_sp_lower = __stk_sp_lower = task->tc_SPLower; /* Lower stack bound */
__stk_initial_sp_upper = __stk_sp_upper = task->tc_SPUpper; /* Upper stack bound +1 */
@@ -297,17 +294,14 @@ __stk_init(void)
D(("stack size = %ld",(ULONG)__stk_sp_upper - (ULONG)__stk_sp_lower));
RETURN(OK);
return(OK);
CONSTRUCTOR_SUCCEED();
}
/****************************************************************************/
/* Free all spare stackframes */
CLIB_DESTRUCTOR(__stk_exit)
STK_DESTRUCTOR(__stk_exit)
{
ENTER();
if(__memory_pool == NULL)
{
struct stackframe *sf, *sf_next;
@@ -323,8 +317,6 @@ CLIB_DESTRUCTOR(__stk_exit)
}
__stk_spare = NULL;
LEAVE();
}
/****************************************************************************/