1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Merge branch 'srs.master'

This commit is contained in:
winlin 2014-11-09 12:06:17 +08:00
commit b200e9f9ce
3 changed files with 1 additions and 47 deletions

View file

@ -144,9 +144,6 @@ typedef struct _st_stack {
char *stk_bottom; /* Lowest address of stack's usable portion */ char *stk_bottom; /* Lowest address of stack's usable portion */
char *stk_top; /* Highest address of stack's usable portion */ char *stk_top; /* Highest address of stack's usable portion */
void *sp; /* Stack pointer from C's point of view */ void *sp; /* Stack pointer from C's point of view */
#ifdef __ia64__
void *bsp; /* Register stack backing store pointer */
#endif
} _st_stack_t; } _st_stack_t;
@ -349,11 +346,7 @@ extern _st_eventsys_t *_st_eventsys;
#define ST_UTIME_NO_TIMEOUT ((st_utime_t) -1LL) #define ST_UTIME_NO_TIMEOUT ((st_utime_t) -1LL)
#endif #endif
#ifndef __ia64__ #define ST_DEFAULT_STACK_SIZE (64*1024)
#define ST_DEFAULT_STACK_SIZE (64*1024)
#else
#define ST_DEFAULT_STACK_SIZE (128*1024) /* Includes register stack size */
#endif
#ifndef ST_KEYS_MAX #ifndef ST_KEYS_MAX
#define ST_KEYS_MAX 16 #define ST_KEYS_MAX 16

View file

@ -532,9 +532,6 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
_st_stack_t *stack; _st_stack_t *stack;
void **ptds; void **ptds;
char *sp; char *sp;
#ifdef __ia64__
char *bsp;
#endif
/* Adjust stack size */ /* Adjust stack size */
if (stk_size == 0) { if (stk_size == 0) {
@ -549,22 +546,6 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
/* Allocate thread object and per-thread data off the stack */ /* Allocate thread object and per-thread data off the stack */
#if defined (MD_STACK_GROWS_DOWN) #if defined (MD_STACK_GROWS_DOWN)
sp = stack->stk_top; sp = stack->stk_top;
#ifdef __ia64__
/*
* The stack segment is split in the middle. The upper half is used
* as backing store for the register stack which grows upward.
* The lower half is used for the traditional memory stack which
* grows downward. Both stacks start in the middle and grow outward
* from each other.
*/
sp -= (stk_size >> 1);
bsp = sp;
/* Make register stack 64-byte aligned */
if ((unsigned long)bsp & 0x3f) {
bsp = bsp + (0x40 - ((unsigned long)bsp & 0x3f));
}
stack->bsp = bsp + _ST_STACK_PAD_SIZE;
#endif
sp = sp - (ST_KEYS_MAX * sizeof(void *)); sp = sp - (ST_KEYS_MAX * sizeof(void *));
ptds = (void **) sp; ptds = (void **) sp;
sp = sp - sizeof(_st_thread_t); sp = sp - sizeof(_st_thread_t);
@ -575,18 +556,6 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
sp = sp - ((unsigned long)sp & 0x3f); sp = sp - ((unsigned long)sp & 0x3f);
} }
stack->sp = sp - _ST_STACK_PAD_SIZE; stack->sp = sp - _ST_STACK_PAD_SIZE;
#elif defined (MD_STACK_GROWS_UP)
sp = stack->stk_bottom;
thread = (_st_thread_t *) sp;
sp = sp + sizeof(_st_thread_t);
ptds = (void **) sp;
sp = sp + (ST_KEYS_MAX * sizeof(void *));
/* Make stack 64-byte aligned */
if ((unsigned long)sp & 0x3f) {
sp = sp + (0x40 - ((unsigned long)sp & 0x3f));
}
stack->sp = sp + _ST_STACK_PAD_SIZE;
#else #else
#error Unknown OS #error Unknown OS
#endif #endif
@ -600,11 +569,7 @@ _st_thread_t *st_thread_create(void *(*start)(void *arg), void *arg, int joinabl
thread->start = start; thread->start = start;
thread->arg = arg; thread->arg = arg;
#ifndef __ia64__
_ST_INIT_CONTEXT(thread, stack->sp, _st_thread_main); _ST_INIT_CONTEXT(thread, stack->sp, _st_thread_main);
#else
_ST_INIT_CONTEXT(thread, stack->sp, stack->bsp, _st_thread_main);
#endif
/* If thread is joinable, allocate a termination condition variable */ /* If thread is joinable, allocate a termination condition variable */
if (joinable) { if (joinable) {

View file

@ -11,10 +11,6 @@
#include "public.h" #include "public.h"
#if defined(__ia64__)
#error "IA64 not supported"
#endif
#define srs_trace(msg, ...) printf(msg, ##__VA_ARGS__);printf("\n") #define srs_trace(msg, ...) printf(msg, ##__VA_ARGS__);printf("\n")
int io_port = 1990; int io_port = 1990;