setjmp.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Port of uClibc for TMS320C6000 DSP architecture
  3. * Copyright (C) 2004 Texas Instruments Incorporated
  4. * Author of TMS320C6000 port: Aurelien Jacquiot
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU Library General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
  14. * for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. *
  20. */
  21. #ifndef _SETJMP_H
  22. # error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
  23. #endif
  24. typedef struct {
  25. unsigned long __regs[12]; /* save A10,B10... A15,B15*/
  26. unsigned long __pc; /* the return address */
  27. } __jmp_buf[1];
  28. /* the stack pointer (B15) */
  29. #define JP_SP 11
  30. /* Test if longjmp to JMPBUF would unwind the frame
  31. containing a local variable at ADDRESS. */
  32. #define _JMPBUF_UNWINDS(jmpbuf, address) \
  33. ((void *) (address) < (void *) (jmpbuf)->__regs[JP_SP])