mirror of
https://github.com/clearlinux/graphene.git
synced 2026-09-07 14:21:56 +00:00
[Pal] Move x86_64 implementation of pal_start to a separate file
This commit is contained in:
committed by
Michał Kowalczyk
parent
122bc94a80
commit
12e8b6b078
@@ -33,7 +33,8 @@ objs = \
|
||||
db_sockets.o \
|
||||
db_streams.o \
|
||||
db_threading.o \
|
||||
$(commons_objs)
|
||||
$(commons_objs) \
|
||||
pal_start-$(ARCH).o
|
||||
|
||||
graphene_lib = .lib/graphene-lib.a
|
||||
|
||||
|
||||
@@ -38,16 +38,6 @@
|
||||
#include <elf/elf.h>
|
||||
#include <sysdeps/generic/ldsodefs.h>
|
||||
|
||||
__asm__ (
|
||||
".global pal_start\n"
|
||||
" .type pal_start,@function\n"
|
||||
"pal_start:\n"
|
||||
" movq %rsp, %rdi\n" /* 1st arg for pal_linux_main: initial RSP */
|
||||
" movq %rdx, %rsi\n" /* 2nd arg: fini callback */
|
||||
" xorq %rbp, %rbp\n" /* mark the last stack frame with RBP == 0 (for debuggers) */
|
||||
" andq $~15, %rsp\n"
|
||||
" call pal_linux_main\n");
|
||||
|
||||
#define RTLD_BOOTSTRAP
|
||||
|
||||
/* pal_start is the entry point of libpal.so, which calls pal_main */
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
This file is part of Graphene Library OS.
|
||||
|
||||
Graphene Library OS is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public License
|
||||
as published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
Graphene Library OS is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* pal_start-x86_64.S
|
||||
*
|
||||
* This file contains architecture-specific implementation of pal_start.
|
||||
*/
|
||||
|
||||
#include "sysdep-arch.h"
|
||||
|
||||
.text
|
||||
ENTRY(pal_start)
|
||||
movq %rsp, %rdi /* 1st arg for pal_linux_main: initial RSP */
|
||||
movq %rdx, %rsi /* 2nd arg: fini callback */
|
||||
xorq %rbp, %rbp /* mark the last stack frame with RBP == 0 (for debuggers) */
|
||||
andq $~15, %rsp
|
||||
call pal_linux_main
|
||||
Reference in New Issue
Block a user