Skip to content

Commit

Permalink
Fix code style
Browse files Browse the repository at this point in the history
Signed-off-by: Petr Shumilov <[email protected]>
  • Loading branch information
PetrShumilov committed Oct 28, 2024
1 parent 5c2b6e2 commit 381fabd
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 14 deletions.
4 changes: 2 additions & 2 deletions common/ucontext/darwin/aarch64/context.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Compiler for PHP (aka KPHP)
// libucontext (c) https://github.com/kaniini/libucontext/tree/master (copied as third-party and slightly modified)
// Copyright (c) 2023 LLC «V Kontakte»
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "context.h"
Expand Down Expand Up @@ -182,4 +182,4 @@ asm(".global " NAME(swapcontext_portable) ";\n"
"bl " NAME(setcontext_portable) "\n"
/* hmm, we came back here try to return */
"mov x30, x28\n"
"ret\n");
"ret\n");
4 changes: 2 additions & 2 deletions common/ucontext/darwin/aarch64/context.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2018-2022 Ariadne Conill <[email protected]>
// https://github.com/kaniini/libucontext/tree/master (copied as third-party and slightly modified)
// Copyright (c) 2023 LLC «V Kontakte»
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#pragma once
Expand Down Expand Up @@ -51,4 +51,4 @@ inline constexpr void set_context_link_portable(libucontext_ucontext &ctx, libuc

inline void *get_context_stack_base_ptr_portable(const libucontext_ucontext &ctx) noexcept {
return reinterpret_cast<void *>(ctx.uc_mcontext.fp);
}
}
6 changes: 5 additions & 1 deletion common/ucontext/linux/aarch64/context.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include <ucontext.h>

inline constexpr void *get_context_stack_ptr_portable(const ucontext_t &ctx) noexcept {
Expand All @@ -23,4 +27,4 @@ inline constexpr void set_context_link_portable(ucontext_t &ctx, ucontext_t *lin
inline void *get_context_stack_base_ptr_portable(const ucontext_t &ctx) noexcept {
// 29 -- Frame Pointer, based on AArch64 spec
return reinterpret_cast<void *>(ctx.uc_mcontext.regs[29]);
}
}
4 changes: 4 additions & 0 deletions common/ucontext/linux/x86_64/context.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include <cstddef>
#include <cstdint>
#include "defs.h"
Expand Down
6 changes: 5 additions & 1 deletion common/ucontext/linux/x86_64/defs.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#ifndef TYPE
# ifdef __clang__
# define TYPE(name) // .type not supported
Expand Down Expand Up @@ -98,4 +102,4 @@
#define oEFL KCONTEXT_MCONTEXT_GREG_OFFSET(GREG_EFL)
#define oFPREGS KCONTEXT_MCONTEXT_FPREGS
#define oFPREGSMEM KCONTEXT_FPREGS_MEM
#define oMXCSR KCONTEXT_FPREGS_MEM_MXCSR
#define oMXCSR KCONTEXT_FPREGS_MEM_MXCSR
6 changes: 5 additions & 1 deletion common/ucontext/linux/x86_64/getcontext.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "defs.h"

/*
Expand Down Expand Up @@ -50,4 +54,4 @@ ENTRY(getcontext_portable)
// All done, return 0 for success
xorl %eax, %eax
ret
END(getcontext_portable)
END(getcontext_portable)
6 changes: 5 additions & 1 deletion common/ucontext/linux/x86_64/makecontext.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "context.h"
#include <stdarg.h>
#include <stdint.h>
Expand Down Expand Up @@ -74,4 +78,4 @@ extern "C" void makecontext_portable(kcontext_t *kcp, void (*func)(void), int ar
break;
}
va_end(ap);
}
}
5 changes: 4 additions & 1 deletion common/ucontext/linux/x86_64/setcontext.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "defs.h"

/*
Expand Down Expand Up @@ -45,4 +49,3 @@ ENTRY(setcontext_portable)
xorl %eax, %eax
ret
END(setcontext_portable)

4 changes: 4 additions & 0 deletions common/ucontext/linux/x86_64/startcontext.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "defs.h"

/*
Expand Down
6 changes: 4 additions & 2 deletions common/ucontext/linux/x86_64/swapcontext.S
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include "defs.h"

/*
Expand Down Expand Up @@ -82,5 +86,3 @@ ENTRY(swapcontext_portable)
xorl %eax, %eax
ret
END(swapcontext_portable)


4 changes: 2 additions & 2 deletions common/ucontext/ucontext-portable-test.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2020 LLC «V Kontakte»
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt

#include <gtest/gtest.h>
Expand Down Expand Up @@ -65,4 +65,4 @@ TEST(ucontext_portable, get_and_setcontext) {
setcontext_portable(&ctx3);
}
ASSERT_EQ(context_set_cnt, 10);
}
}
2 changes: 1 addition & 1 deletion common/ucontext/ucontext-portable.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Compiler for PHP (aka KPHP)
// Copyright (c) 2021 LLC «V Kontakte»
// Copyright (c) 2024 LLC «V Kontakte»
// Distributed under the GPL v3 License, see LICENSE.notice.txt
#pragma once

Expand Down

0 comments on commit 381fabd

Please sign in to comment.