Root/
Source at commit 1079 created 13 years 1 month ago. By meklort, began implimenting Bios disk changes. Code taken from biosfn.c | |
---|---|
1 | /*␉Copyright (C) 2004 Garrett A. Kajmowicz␊ |
2 | ␊ |
3 | ␉This file is part of the uClibc++ Library. ␊ |
4 | ␊ |
5 | ␉This library is free software; you can redistribute it and/or␊ |
6 | ␉modify it under the terms of the GNU Lesser General Public␊ |
7 | ␉License as published by the Free Software Foundation; either␊ |
8 | ␉version 2.1 of the License, or (at your option) any later version.␊ |
9 | ␊ |
10 | ␉This library is distributed in the hope that it will be useful,␊ |
11 | ␉but WITHOUT ANY WARRANTY; without even the implied warranty of␊ |
12 | ␉MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU␊ |
13 | ␉Lesser General Public License for more details.␊ |
14 | ␊ |
15 | ␉You should have received a copy of the GNU Lesser General Public␊ |
16 | ␉License along with this library; if not, write to the Free Software␊ |
17 | ␉Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA␊ |
18 | */␊ |
19 | ␊ |
20 | #include <support>␊ |
21 | #ifdef __UCLIBCXX_EXCEPTION_SUPPORT__␊ |
22 | extern "C" void *__cxa_allocate_exception(size_t thrown_size)␊ |
23 | {␊ |
24 | ␉void * retval;␊ |
25 | ␊ |
26 | ␉/*The amount of data needed is the size of the object *PLUS*␊ |
27 | ␉the size of the header. The header is of struct __cxa_exception␊ |
28 | ␉The address needs to be adjusted because the pointer we return␊ |
29 | ␉should not point to the start of the memory, but to the point␊ |
30 | ␉where the object being thrown actually starts*/␊ |
31 | ␊ |
32 | ␉retval = malloc(thrown_size + sizeof(__cxa_exception));␊ |
33 | ␊ |
34 | //␉Check to see that we actuall allocated memory␊ |
35 | ␉if(retval == 0){␊ |
36 | ␉␉std::terminate();␊ |
37 | ␉}␊ |
38 | ␊ |
39 | ␉//Need to do a typecast to char* otherwize we are doing math with␊ |
40 | ␉//a void* which makes the compiler cranky (Like me)␊ |
41 | ␉return ((char *)retval + sizeof(__cxa_exception));␊ |
42 | }␊ |
43 | ␊ |
44 | extern "C" void __cxa_free_exception(void *thrown_exception){␊ |
45 | ␊ |
46 | ␊ |
47 | ␊ |
48 | }␊ |
49 | ␊ |
50 | extern "C" void __cxa_throw (void *thrown_exception, std::type_info *tinfo,void (*dest) (void *) ){␊ |
51 | ␊ |
52 | }␊ |
53 | #endif␊ |
54 | ␊ |
55 |