mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 14:02:22 +00:00
SVN Maintenance: set eol-style:native for lib/sdk/crt.
svn path=/trunk/; revision=34046
This commit is contained in:
parent
39fd08d7ce
commit
e1419be7cd
2 changed files with 190 additions and 190 deletions
|
@ -1,75 +1,75 @@
|
||||||
/*
|
/*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS CRT
|
* PROJECT: ReactOS CRT
|
||||||
* FILE: lib/crt/misc/i386/seh.S
|
* FILE: lib/crt/misc/i386/seh.S
|
||||||
* PURPOSE: SEH Support for the CRT
|
* PURPOSE: SEH Support for the CRT
|
||||||
* PROGRAMMERS: arty
|
* PROGRAMMERS: arty
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
/* INCLUDES ******************************************************************/
|
||||||
|
|
||||||
#include <ndk/asm.h>
|
#include <ndk/asm.h>
|
||||||
|
|
||||||
#define DISPOSITION_DISMISS 0
|
#define DISPOSITION_DISMISS 0
|
||||||
#define DISPOSITION_CONTINUE_SEARCH 1
|
#define DISPOSITION_CONTINUE_SEARCH 1
|
||||||
#define DISPOSITION_COLLIDED_UNWIND 3
|
#define DISPOSITION_COLLIDED_UNWIND 3
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
.globl _global_unwind2
|
.globl _global_unwind2
|
||||||
.globl _local_unwind2
|
.globl _local_unwind2
|
||||||
.globl _abnormal_termination
|
.globl _abnormal_termination
|
||||||
.globl _except_handler2
|
.globl _except_handler2
|
||||||
.globl _except_handler3
|
.globl _except_handler3
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
unwind_handler:
|
unwind_handler:
|
||||||
blr
|
blr
|
||||||
|
|
||||||
_global_unwind2:
|
_global_unwind2:
|
||||||
blr
|
blr
|
||||||
|
|
||||||
_local_unwind2:
|
_local_unwind2:
|
||||||
blr
|
blr
|
||||||
|
|
||||||
_except_handler2:
|
_except_handler2:
|
||||||
blr
|
blr
|
||||||
|
|
||||||
_except_handler3:
|
_except_handler3:
|
||||||
blr
|
blr
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME
|
// REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME REMOVE ME
|
||||||
// sorry
|
// sorry
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
.globl RtlpGetStackLimits
|
.globl RtlpGetStackLimits
|
||||||
RtlpGetStackLimits:
|
RtlpGetStackLimits:
|
||||||
stwu 1,16(1)
|
stwu 1,16(1)
|
||||||
mflr 0
|
mflr 0
|
||||||
|
|
||||||
stw 0,4(1)
|
stw 0,4(1)
|
||||||
stw 3,8(1)
|
stw 3,8(1)
|
||||||
stw 4,12(1)
|
stw 4,12(1)
|
||||||
|
|
||||||
/* Get the current thread */
|
/* Get the current thread */
|
||||||
lwz 3,KPCR_CURRENT_THREAD(13)
|
lwz 3,KPCR_CURRENT_THREAD(13)
|
||||||
|
|
||||||
/* Get the stack limits */
|
/* Get the stack limits */
|
||||||
lwz 4,KTHREAD_STACK_LIMIT(3)
|
lwz 4,KTHREAD_STACK_LIMIT(3)
|
||||||
lwz 5,KTHREAD_INITIAL_STACK(3)
|
lwz 5,KTHREAD_INITIAL_STACK(3)
|
||||||
subi 5,5,SIZEOF_FX_SAVE_AREA
|
subi 5,5,SIZEOF_FX_SAVE_AREA
|
||||||
|
|
||||||
/* Return them */
|
/* Return them */
|
||||||
lwz 3,8(1)
|
lwz 3,8(1)
|
||||||
stw 4,0(3)
|
stw 4,0(3)
|
||||||
|
|
||||||
lwz 3,12(1)
|
lwz 3,12(1)
|
||||||
stw 5,0(3)
|
stw 5,0(3)
|
||||||
|
|
||||||
addi 1,1,16
|
addi 1,1,16
|
||||||
|
|
||||||
/* return */
|
/* return */
|
||||||
blr
|
blr
|
||||||
|
|
|
@ -1,115 +1,115 @@
|
||||||
/*
|
/*
|
||||||
* msvcrt.dll thread functions
|
* msvcrt.dll thread functions
|
||||||
*
|
*
|
||||||
* Copyright 2000 Jon Griffiths
|
* Copyright 2000 Jon Griffiths
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
* License as published by the Free Software Foundation; either
|
* License as published by the Free Software Foundation; either
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
* version 2.1 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This library is distributed in the hope that it will be useful,
|
* This library is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <precomp.h>
|
#include <precomp.h>
|
||||||
#include <internal/wine/msvcrt.h>
|
#include <internal/wine/msvcrt.h>
|
||||||
|
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
|
|
||||||
void _amsg_exit (int errnum);
|
void _amsg_exit (int errnum);
|
||||||
/* Index to TLS */
|
/* Index to TLS */
|
||||||
DWORD MSVCRT_tls_index;
|
DWORD MSVCRT_tls_index;
|
||||||
|
|
||||||
typedef void (*_beginthread_start_routine_t)(void *);
|
typedef void (*_beginthread_start_routine_t)(void *);
|
||||||
typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
|
typedef unsigned int (__stdcall *_beginthreadex_start_routine_t)(void *);
|
||||||
|
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
_beginthread_start_routine_t start_address;
|
_beginthread_start_routine_t start_address;
|
||||||
void *arglist;
|
void *arglist;
|
||||||
} _beginthread_trampoline_t;
|
} _beginthread_trampoline_t;
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* msvcrt_get_thread_data
|
* msvcrt_get_thread_data
|
||||||
*
|
*
|
||||||
* Return the thread local storage structure.
|
* Return the thread local storage structure.
|
||||||
*/
|
*/
|
||||||
MSVCRT_thread_data *msvcrt_get_thread_data(void)
|
MSVCRT_thread_data *msvcrt_get_thread_data(void)
|
||||||
{
|
{
|
||||||
MSVCRT_thread_data *ptr;
|
MSVCRT_thread_data *ptr;
|
||||||
DWORD err = GetLastError(); /* need to preserve last error */
|
DWORD err = GetLastError(); /* need to preserve last error */
|
||||||
|
|
||||||
if (!(ptr = TlsGetValue( MSVCRT_tls_index )))
|
if (!(ptr = TlsGetValue( MSVCRT_tls_index )))
|
||||||
{
|
{
|
||||||
if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
|
if (!(ptr = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ptr) )))
|
||||||
_amsg_exit( _RT_THREAD );
|
_amsg_exit( _RT_THREAD );
|
||||||
if (!TlsSetValue( MSVCRT_tls_index, ptr )) _amsg_exit( _RT_THREAD );
|
if (!TlsSetValue( MSVCRT_tls_index, ptr )) _amsg_exit( _RT_THREAD );
|
||||||
ptr->random_seed = 1;
|
ptr->random_seed = 1;
|
||||||
}
|
}
|
||||||
SetLastError( err );
|
SetLastError( err );
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _beginthread_trampoline
|
* _beginthread_trampoline
|
||||||
*/
|
*/
|
||||||
static DWORD CALLBACK _beginthread_trampoline(LPVOID arg)
|
static DWORD CALLBACK _beginthread_trampoline(LPVOID arg)
|
||||||
{
|
{
|
||||||
_beginthread_trampoline_t local_trampoline;
|
_beginthread_trampoline_t local_trampoline;
|
||||||
|
|
||||||
/* Maybe it's just being paranoid, but freeing arg right
|
/* Maybe it's just being paranoid, but freeing arg right
|
||||||
* away seems safer.
|
* away seems safer.
|
||||||
*/
|
*/
|
||||||
memcpy(&local_trampoline,arg,sizeof(local_trampoline));
|
memcpy(&local_trampoline,arg,sizeof(local_trampoline));
|
||||||
free(arg);
|
free(arg);
|
||||||
|
|
||||||
local_trampoline.start_address(local_trampoline.arglist);
|
local_trampoline.start_address(local_trampoline.arglist);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _beginthread (MSVCRT.@)
|
* _beginthread (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
unsigned long _beginthread(
|
unsigned long _beginthread(
|
||||||
_beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
_beginthread_start_routine_t start_address, /* [in] Start address of routine that begins execution of new thread */
|
||||||
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
|
unsigned int stack_size, /* [in] Stack size for new thread or 0 */
|
||||||
void *arglist) /* [in] Argument list to be passed to new thread or NULL */
|
void *arglist) /* [in] Argument list to be passed to new thread or NULL */
|
||||||
{
|
{
|
||||||
_beginthread_trampoline_t* trampoline;
|
_beginthread_trampoline_t* trampoline;
|
||||||
|
|
||||||
TRACE("(%p, %d, %p)\n", start_address, stack_size, arglist);
|
TRACE("(%p, %d, %p)\n", start_address, stack_size, arglist);
|
||||||
|
|
||||||
/* Allocate the trampoline here so that it is still valid when the thread
|
/* Allocate the trampoline here so that it is still valid when the thread
|
||||||
* starts... typically after this function has returned.
|
* starts... typically after this function has returned.
|
||||||
* _beginthread_trampoline is responsible for freeing the trampoline
|
* _beginthread_trampoline is responsible for freeing the trampoline
|
||||||
*/
|
*/
|
||||||
trampoline=malloc(sizeof(*trampoline));
|
trampoline=malloc(sizeof(*trampoline));
|
||||||
trampoline->start_address = start_address;
|
trampoline->start_address = start_address;
|
||||||
trampoline->arglist = arglist;
|
trampoline->arglist = arglist;
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
return (unsigned long)CreateThread(NULL, stack_size, _beginthread_trampoline,
|
return (unsigned long)CreateThread(NULL, stack_size, _beginthread_trampoline,
|
||||||
trampoline, 0, NULL);
|
trampoline, 0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
* _endthread (MSVCRT.@)
|
* _endthread (MSVCRT.@)
|
||||||
*/
|
*/
|
||||||
void CDECL _endthread(void)
|
void CDECL _endthread(void)
|
||||||
{
|
{
|
||||||
TRACE("(void)\n");
|
TRACE("(void)\n");
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
ExitThread(0);
|
ExitThread(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue