A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 70 lines 2.6 kB view raw
1/*************************************************************************** 2 * __________ __ ___. 3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___ 4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / 5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < 6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ 7 * \/ \/ \/ \/ \/ 8 * $Id$ 9 * 10 * Copyright (C) 2002 by Ulf Ralberg 11 * 12 * This program is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU General Public License 14 * as published by the Free Software Foundation; either version 2 15 * of the License, or (at your option) any later version. 16 * 17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 18 * KIND, either express or implied. 19 * 20 ****************************************************************************/ 21 22#ifndef __ASM_THREAD_H__ 23#define __ASM_THREAD_H__ 24#include "config.h" 25 26/* generic thread.h */ 27 28#if defined(HAVE_WIN32_FIBER_THREADS) || defined(HAVE_SIGALTSTACK_THREADS) 29 30struct regs 31{ 32 void (*start)(void); /* thread's entry point, or NULL when started */ 33 void* uc; /* host thread handle */ 34 uintptr_t sp; /* Stack pointer, unused */ 35 size_t stack_size; /* stack size, not always used */ 36 uintptr_t stack; /* pointer to start of the stack buffer */ 37}; 38 #include <errno.h> 39 #ifdef HAVE_SIGALTSTACK_THREADS 40 #include <signal.h> 41 #ifdef _DYNAMIC_STACK_SIZE_SOURCE 42 /* glibc 2.34 made MINSIGSTKSZ non-constant. This is a problem for sim 43 * builds. Hosted targets are using ancient glibc where MINSIGSTKSZ is 44 * still a compile time constant. On platforms where this is a problem 45 * (mainly x86-64 and ARM64) the signal stack size can be big, so let's 46 * give a decent amount of space and hope for the best... 47 * FIXME: this isn't a great solution. */ 48 #undef MINSIGSTKSZ 49 #endif 50 #ifndef MINSIGSTKSZ 51 #define MINSIGSTKSZ 16384 52 #endif 53 /* MINSIGSTKSZ for the OS to deliver the signal, plus more for us */ 54#if defined(SIMULATOR) || defined(__aarch64__) 55 #define DEFAULT_STACK_SIZE (MINSIGSTKSZ+0x6000) /* Bytes */ 56#else 57 #define DEFAULT_STACK_SIZE (MINSIGSTKSZ+0x3000) /* Bytes */ 58#endif 59 #elif defined(HAVE_WIN32_FIBER_THREADS) 60 #define DEFAULT_STACK_SIZE 0x1000 /* Bytes */ 61 #endif 62#elif defined(CPU_ARM) 63 #include "arm/thread.h" 64#elif defined(CPU_COLDFIRE) 65 #include "m68k/thread.h" 66#elif defined(CPU_MIPS) 67 #include "mips/thread.h" 68#endif 69 70#endif