OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [iq2000/] [_exit.c] - Blame information for rev 326

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <_ansi.h>
2
#include <sys/types.h>
3
#include <sys/stat.h>
4
#include "trap.h"
5
 
6
 
7
static void _do_dtors()
8
{
9
  /* The loop variable is static so that if a destructor calls exit,
10
     and we return here, we simply continue with the next destructor. */
11
  typedef void (*pfunc) ();
12
  extern pfunc __dtors[];
13
  extern pfunc __dtors_end[];
14
  static pfunc *p = __dtors;
15
 
16
  while (p < __dtors_end)
17
    (*p++) ();
18
}
19
 
20
 
21
void _exit (n)
22
{
23
  extern unsigned char __eh_frame_begin[];
24
  extern void __deregister_frame_info (void *);
25
 
26
  /* Destructors should be done earlier because they need to be done before the
27
     files are closed, but here is better than nowhere (and this balances the
28
     constructors done in crt1.c. */
29
  _do_dtors();
30
 
31
  /* Deregister any eh frames.  */
32
  __deregister_frame_info (__eh_frame_begin);
33
 
34
  TRAP0 (SYS_exit, n, 0, 0);
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.