Commit e04f683d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pie: x86-32 -- Prepare parasite head

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b07bbf81
#ifndef __ASM_PARASITE_H__
#define __ASM_PARASITE_H__
#ifdef CONFIG_X86_32
# define __parasite_entry __attribute__((regparm(3)))
#endif
static inline void arch_get_tls(tls_t *ptls) { (void)ptls; }
#endif
......@@ -2,6 +2,9 @@
#include "parasite.h"
.section .head.text, "ax"
#ifdef CONFIG_X86_64
ENTRY(__export_parasite_head_start)
subq $16, %rsp
andq $~15, %rsp
......@@ -15,3 +18,23 @@ ENTRY(__export_parasite_head_start)
__export_parasite_cmd:
.long 0
END(__export_parasite_head_start)
#else /* CONFIG_X86_64 */
ENTRY(__export_parasite_head_start)
subl $8, %esp
andl $~7, %esp
pushl $0
movl %esp, %ebp
call 1f
1: popl %ecx
2: leal (__export_parasite_cmd-2b)(%ecx), %eax
leal (__export_parasite_args-2b)(%ecx), %edx
call parasite_service
int $0x03
.align 8
GLOBAL(__export_parasite_cmd)
.long 0
END(__export_parasite_head_start)
#endif /* CONFIG_X86_64 */
......@@ -690,7 +690,11 @@ err:
return -1;
}
int __used parasite_service(unsigned int cmd, void *args)
#ifndef __parasite_entry
# define __parasite_entry
#endif
int __used __parasite_entry parasite_service(unsigned int cmd, void *args)
{
pr_info("Parasite cmd %d/%x process\n", cmd, cmd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment