2018-01-31 04:11:46 +00:00
|
|
|
/*
|
2020-03-30 05:02:49 +00:00
|
|
|
* Copyright (c) 2018, 2020 Ariadne Conill <ariadne@dereferenced.org>
|
2018-01-31 04:11:46 +00:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* This software is provided 'as is' and without any warranty, express or
|
|
|
|
* implied. In no event shall the authors be liable for any damages arising
|
|
|
|
* from the use of this software.
|
|
|
|
*/
|
|
|
|
|
2020-03-30 05:02:49 +00:00
|
|
|
#include "defs.h"
|
|
|
|
|
2020-12-06 09:02:25 +00:00
|
|
|
ALIAS(getcontext, libucontext_getcontext)
|
2020-03-30 05:02:49 +00:00
|
|
|
|
2020-12-06 09:02:25 +00:00
|
|
|
FUNC(libucontext_getcontext)
|
2018-01-31 04:11:46 +00:00
|
|
|
/* copy all of the current registers into the ucontext structure */
|
2020-03-30 05:02:49 +00:00
|
|
|
add r1, r0, #REG_OFFSET(4)
|
2018-01-31 04:11:46 +00:00
|
|
|
stmia r1, {r4-r12}
|
2020-03-30 05:02:49 +00:00
|
|
|
str r13, [r0, #REG_OFFSET(13)]
|
|
|
|
str r14, [r0, #REG_OFFSET(15)]
|
2018-01-31 04:11:46 +00:00
|
|
|
|
|
|
|
/* return 0 */
|
|
|
|
mov r0, #0
|
|
|
|
mov pc, lr
|
2020-12-06 09:02:25 +00:00
|
|
|
END(libucontext_getcontext)
|