diff options
| author | 2020-06-28 12:37:50 -0400 | |
|---|---|---|
| committer | 2020-06-28 12:37:50 -0400 | |
| commit | b05795d704e0c194215f815a5703db09e524b59a (patch) | |
| tree | ecf4023b4ee0c91555c1d8263762fcb9dcb04a17 /src/core/memory.h | |
| parent | Merge pull request #4196 from ogniK5377/nrr-nro-fixes (diff) | |
| parent | Core/Common: Address Feedback. (diff) | |
| download | yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.gz yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.xz yuzu-b05795d704e0c194215f815a5703db09e524b59a.zip | |
Merge pull request #3955 from FernandoS27/prometheus-2b
Remake Kernel Scheduling, CPU Management & Boot Management (Prometheus)
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index 9292f3b0a..4a1cc63f4 100644 --- a/src/core/memory.h +++ b/src/core/memory.h | |||
| @@ -64,7 +64,7 @@ public: | |||
| 64 | * | 64 | * |
| 65 | * @param process The process to use the page table of. | 65 | * @param process The process to use the page table of. |
| 66 | */ | 66 | */ |
| 67 | void SetCurrentPageTable(Kernel::Process& process); | 67 | void SetCurrentPageTable(Kernel::Process& process, u32 core_id); |
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | * Maps an allocated buffer onto a region of the emulated process address space. | 70 | * Maps an allocated buffer onto a region of the emulated process address space. |
| @@ -245,6 +245,71 @@ public: | |||
| 245 | void Write64(VAddr addr, u64 data); | 245 | void Write64(VAddr addr, u64 data); |
| 246 | 246 | ||
| 247 | /** | 247 | /** |
| 248 | * Writes a 8-bit unsigned integer to the given virtual address in | ||
| 249 | * the current process' address space if and only if the address contains | ||
| 250 | * the expected value. This operation is atomic. | ||
| 251 | * | ||
| 252 | * @param addr The virtual address to write the 8-bit unsigned integer to. | ||
| 253 | * @param data The 8-bit unsigned integer to write to the given virtual address. | ||
| 254 | * @param expected The 8-bit unsigned integer to check against the given virtual address. | ||
| 255 | * | ||
| 256 | * @post The memory range [addr, sizeof(data)) contains the given data value. | ||
| 257 | */ | ||
| 258 | bool WriteExclusive8(VAddr addr, u8 data, u8 expected); | ||
| 259 | |||
| 260 | /** | ||
| 261 | * Writes a 16-bit unsigned integer to the given virtual address in | ||
| 262 | * the current process' address space if and only if the address contains | ||
| 263 | * the expected value. This operation is atomic. | ||
| 264 | * | ||
| 265 | * @param addr The virtual address to write the 16-bit unsigned integer to. | ||
| 266 | * @param data The 16-bit unsigned integer to write to the given virtual address. | ||
| 267 | * @param expected The 16-bit unsigned integer to check against the given virtual address. | ||
| 268 | * | ||
| 269 | * @post The memory range [addr, sizeof(data)) contains the given data value. | ||
| 270 | */ | ||
| 271 | bool WriteExclusive16(VAddr addr, u16 data, u16 expected); | ||
| 272 | |||
| 273 | /** | ||
| 274 | * Writes a 32-bit unsigned integer to the given virtual address in | ||
| 275 | * the current process' address space if and only if the address contains | ||
| 276 | * the expected value. This operation is atomic. | ||
| 277 | * | ||
| 278 | * @param addr The virtual address to write the 32-bit unsigned integer to. | ||
| 279 | * @param data The 32-bit unsigned integer to write to the given virtual address. | ||
| 280 | * @param expected The 32-bit unsigned integer to check against the given virtual address. | ||
| 281 | * | ||
| 282 | * @post The memory range [addr, sizeof(data)) contains the given data value. | ||
| 283 | */ | ||
| 284 | bool WriteExclusive32(VAddr addr, u32 data, u32 expected); | ||
| 285 | |||
| 286 | /** | ||
| 287 | * Writes a 64-bit unsigned integer to the given virtual address in | ||
| 288 | * the current process' address space if and only if the address contains | ||
| 289 | * the expected value. This operation is atomic. | ||
| 290 | * | ||
| 291 | * @param addr The virtual address to write the 64-bit unsigned integer to. | ||
| 292 | * @param data The 64-bit unsigned integer to write to the given virtual address. | ||
| 293 | * @param expected The 64-bit unsigned integer to check against the given virtual address. | ||
| 294 | * | ||
| 295 | * @post The memory range [addr, sizeof(data)) contains the given data value. | ||
| 296 | */ | ||
| 297 | bool WriteExclusive64(VAddr addr, u64 data, u64 expected); | ||
| 298 | |||
| 299 | /** | ||
| 300 | * Writes a 128-bit unsigned integer to the given virtual address in | ||
| 301 | * the current process' address space if and only if the address contains | ||
| 302 | * the expected value. This operation is atomic. | ||
| 303 | * | ||
| 304 | * @param addr The virtual address to write the 128-bit unsigned integer to. | ||
| 305 | * @param data The 128-bit unsigned integer to write to the given virtual address. | ||
| 306 | * @param expected The 128-bit unsigned integer to check against the given virtual address. | ||
| 307 | * | ||
| 308 | * @post The memory range [addr, sizeof(data)) contains the given data value. | ||
| 309 | */ | ||
| 310 | bool WriteExclusive128(VAddr addr, u128 data, u128 expected); | ||
| 311 | |||
| 312 | /** | ||
| 248 | * Reads a null-terminated string from the given virtual address. | 313 | * Reads a null-terminated string from the given virtual address. |
| 249 | * This function will continually read characters until either: | 314 | * This function will continually read characters until either: |
| 250 | * | 315 | * |