瀏覽代碼

Kernel+Userland: Unify declarations for KCOV in Kernel/API/kcov.h

Liav A 2 年之前
父節點
當前提交
8f3c343b88
共有 3 個文件被更改,包括 2 次插入5 次删除
  1. 0 1
      Kernel/API/kcov.h
  2. 1 3
      Kernel/Devices/KCOVInstance.h
  3. 1 1
      Userland/Utilities/kcov-example.cpp

+ 0 - 1
Userland/Libraries/LibC/sys/kcov.h → Kernel/API/kcov.h

@@ -8,6 +8,5 @@
 
 #include <AK/Types.h>
 
-// Note: These need to be kept in sync with Kernel/Devices/KCOVInstance.h
 typedef volatile u64 kcov_pc_t;
 #define KCOV_ENTRY_SIZE sizeof(kcov_pc_t)

+ 1 - 3
Kernel/Devices/KCOVInstance.h

@@ -6,14 +6,12 @@
 
 #pragma once
 
+#include <Kernel/API/kcov.h>
 #include <Kernel/Locking/Spinlock.h>
 #include <Kernel/Memory/AnonymousVMObject.h>
 
 namespace Kernel {
 
-// Note: These need to be kept in sync with Userland/Libraries/LibC/sys/kcov.h
-typedef volatile u64 kcov_pc_t;
-#define KCOV_ENTRY_SIZE sizeof(kcov_pc_t)
 #define KCOV_MAX_ENTRIES (10 * 1024 * 1024)
 
 /*

+ 1 - 1
Userland/Utilities/kcov-example.cpp

@@ -4,12 +4,12 @@
  * SPDX-License-Identifier: BSD-2-Clause
  */
 
+#include <Kernel/API/kcov.h>
 #include <LibCore/System.h>
 #include <LibMain/Main.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <sys/ioctl.h>
-#include <sys/kcov.h>
 #include <sys/mman.h>
 #include <unistd.h>