core: clean up warnings
This commit is contained in:
parent
ba6eee71f5
commit
74cd98ecad
35 changed files with 82 additions and 77 deletions
|
@ -240,13 +240,13 @@ MappedBuffer::MappedBuffer(const Process& process, u32 descriptor, VAddr address
|
|||
void MappedBuffer::Read(void* dest_buffer, size_t offset, size_t size) {
|
||||
ASSERT(perms & IPC::R);
|
||||
ASSERT(offset + size <= this->size);
|
||||
Memory::ReadBlock(*process, address + offset, dest_buffer, size);
|
||||
Memory::ReadBlock(*process, address + static_cast<VAddr>(offset), dest_buffer, size);
|
||||
}
|
||||
|
||||
void MappedBuffer::Write(const void* src_buffer, size_t offset, size_t size) {
|
||||
ASSERT(perms & IPC::W);
|
||||
ASSERT(offset + size <= this->size);
|
||||
Memory::WriteBlock(*process, address + offset, src_buffer, size);
|
||||
Memory::WriteBlock(*process, address + static_cast<VAddr>(offset), src_buffer, size);
|
||||
}
|
||||
|
||||
} // namespace Kernel
|
||||
|
|
|
@ -120,7 +120,7 @@ ResultCode TranslateCommandBuffer(SharedPtr<Thread> src_thread, SharedPtr<Thread
|
|||
IPC::MappedBufferDescInfo descInfo{descriptor};
|
||||
VAddr source_address = cmd_buf[i];
|
||||
|
||||
size_t size = descInfo.size;
|
||||
u32 size = static_cast<u32>(descInfo.size);
|
||||
IPC::MappedBufferPermissions permissions = descInfo.perms;
|
||||
|
||||
VAddr page_start = Common::AlignDown(source_address, Memory::PAGE_SIZE);
|
||||
|
@ -182,17 +182,18 @@ ResultCode TranslateCommandBuffer(SharedPtr<Thread> src_thread, SharedPtr<Thread
|
|||
Common::AlignUp(source_address, Memory::PAGE_SIZE) - source_address;
|
||||
// If the data fits in one page we can just copy the required size instead of the
|
||||
// entire page.
|
||||
size_t read_size = num_pages == 1 ? size : difference_to_page;
|
||||
size_t read_size = num_pages == 1 ? static_cast<size_t>(size) : difference_to_page;
|
||||
|
||||
Memory::ReadBlock(*src_process, source_address, buffer->data() + page_offset,
|
||||
read_size);
|
||||
|
||||
// Map the page into the target process' address space.
|
||||
target_address = dst_process->vm_manager
|
||||
.MapMemoryBlockToBase(
|
||||
Memory::IPC_MAPPING_VADDR, Memory::IPC_MAPPING_SIZE,
|
||||
buffer, 0, buffer->size(), Kernel::MemoryState::Shared)
|
||||
.Unwrap();
|
||||
target_address =
|
||||
dst_process->vm_manager
|
||||
.MapMemoryBlockToBase(Memory::IPC_MAPPING_VADDR, Memory::IPC_MAPPING_SIZE,
|
||||
buffer, 0, static_cast<u32>(buffer->size()),
|
||||
Kernel::MemoryState::Shared)
|
||||
.Unwrap();
|
||||
}
|
||||
|
||||
cmd_buf[i++] = target_address + page_offset;
|
||||
|
|
|
@ -188,7 +188,7 @@ void ExitCurrentThread() {
|
|||
* @param thread_handle The handle of the thread that's been awoken
|
||||
* @param cycles_late The number of CPU cycles that have passed since the desired wakeup time
|
||||
*/
|
||||
static void ThreadWakeupCallback(u64 thread_handle, int cycles_late) {
|
||||
static void ThreadWakeupCallback(u64 thread_handle, s64 cycles_late) {
|
||||
SharedPtr<Thread> thread = wakeup_callback_handle_table.Get<Thread>((Handle)thread_handle);
|
||||
if (thread == nullptr) {
|
||||
LOG_CRITICAL(Kernel, "Callback fired for invalid thread {:08X}", (Handle)thread_handle);
|
||||
|
|
|
@ -76,7 +76,7 @@ void Timer::WakeupAllWaitingThreads() {
|
|||
signaled = false;
|
||||
}
|
||||
|
||||
void Timer::Signal(int cycles_late) {
|
||||
void Timer::Signal(s64 cycles_late) {
|
||||
LOG_TRACE(Kernel, "Timer {} fired", GetObjectId());
|
||||
|
||||
signaled = true;
|
||||
|
@ -92,7 +92,7 @@ void Timer::Signal(int cycles_late) {
|
|||
}
|
||||
|
||||
/// The timer callback event, called when a timer is fired
|
||||
static void TimerCallback(u64 timer_handle, int cycles_late) {
|
||||
static void TimerCallback(u64 timer_handle, s64 cycles_late) {
|
||||
SharedPtr<Timer> timer =
|
||||
timer_callback_handle_table.Get<Timer>(static_cast<Handle>(timer_handle));
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
* This method should not be called from outside the timer callback handler,
|
||||
* lest multiple callback events get scheduled.
|
||||
*/
|
||||
void Signal(int cycles_late);
|
||||
void Signal(s64 cycles_late);
|
||||
|
||||
private:
|
||||
Timer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue