Skip to content

Commit

Permalink
Use 16384 and __loongarch__ instead of 4096*4 and
Browse files Browse the repository at this point in the history
`__loongarch_lp64`
  • Loading branch information
Ami-zhang committed Sep 28, 2023
1 parent 1490e6a commit aae67de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/cfi/cfi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using namespace __sanitizer;
namespace __cfi {

#if SANITIZER_LOONGARCH64
#define kCfiShadowLimitsStorageSize 4096 * 4 // 16KiB on loongarch64 per page
#define kCfiShadowLimitsStorageSize 16384 // 16KiB on loongarch64 per page
#else
#define kCfiShadowLimitsStorageSize 4096 // 1 page
#endif
Expand Down
6 changes: 3 additions & 3 deletions compiler-rt/test/cfi/cross-dso/icall/dlopen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ struct A {
virtual void f();
};

// The page size of LoongArch is 16KB, aligned to the memory page size.
#ifdef __loongarch_lp64
# define PAGESIZE 4096 * 4
// The page size of LoongArch is 16KiB, aligned to the memory page size.
#ifdef __loongarch__
# define PAGESIZE 16384
#else
# define PAGESIZE 4096
#endif
Expand Down

0 comments on commit aae67de

Please sign in to comment.