diff options
| author | 2014-12-12 23:20:01 -0500 | |
|---|---|---|
| committer | 2014-12-12 23:20:01 -0500 | |
| commit | af1cd769e7b407af71496e788e218add31f8b2b0 (patch) | |
| tree | 1e3fd71256c04a15970b09abd3f7280f8b1ff678 /src/core/hle/kernel/archive.cpp | |
| parent | Merge pull request #267 from bunnei/apt-shared-font (diff) | |
| parent | Remove old logging system (diff) | |
| download | yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.gz yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.tar.xz yuzu-af1cd769e7b407af71496e788e218add31f8b2b0.zip | |
Merge pull request #258 from yuriks/log-ng
New logging system
Diffstat (limited to 'src/core/hle/kernel/archive.cpp')
| -rw-r--r-- | src/core/hle/kernel/archive.cpp | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/src/core/hle/kernel/archive.cpp b/src/core/hle/kernel/archive.cpp index a875fa7ff..ddc09e13b 100644 --- a/src/core/hle/kernel/archive.cpp +++ b/src/core/hle/kernel/archive.cpp | |||
| @@ -94,26 +94,20 @@ public: | |||
| 94 | } | 94 | } |
| 95 | case FileCommand::Close: | 95 | case FileCommand::Close: |
| 96 | { | 96 | { |
| 97 | DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); | 97 | LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); |
| 98 | CloseArchive(backend->GetIdCode()); | 98 | CloseArchive(backend->GetIdCode()); |
| 99 | break; | 99 | break; |
| 100 | } | 100 | } |
| 101 | // Unknown command... | 101 | // Unknown command... |
| 102 | default: | 102 | default: |
| 103 | { | 103 | { |
| 104 | ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); | 104 | LOG_ERROR(Service_FS, "Unknown command=0x%08X", cmd); |
| 105 | return UnimplementedFunction(ErrorModule::FS); | 105 | return UnimplementedFunction(ErrorModule::FS); |
| 106 | } | 106 | } |
| 107 | } | 107 | } |
| 108 | cmd_buff[1] = 0; // No error | 108 | cmd_buff[1] = 0; // No error |
| 109 | return MakeResult<bool>(false); | 109 | return MakeResult<bool>(false); |
| 110 | } | 110 | } |
| 111 | |||
| 112 | ResultVal<bool> WaitSynchronization() override { | ||
| 113 | // TODO(bunnei): ImplementMe | ||
| 114 | ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); | ||
| 115 | return UnimplementedFunction(ErrorModule::FS); | ||
| 116 | } | ||
| 117 | }; | 111 | }; |
| 118 | 112 | ||
| 119 | class File : public Object { | 113 | class File : public Object { |
| @@ -138,7 +132,7 @@ public: | |||
| 138 | u64 offset = cmd_buff[1] | ((u64) cmd_buff[2]) << 32; | 132 | u64 offset = cmd_buff[1] | ((u64) cmd_buff[2]) << 32; |
| 139 | u32 length = cmd_buff[3]; | 133 | u32 length = cmd_buff[3]; |
| 140 | u32 address = cmd_buff[5]; | 134 | u32 address = cmd_buff[5]; |
| 141 | DEBUG_LOG(KERNEL, "Read %s %s: offset=0x%llx length=%d address=0x%x", | 135 | LOG_TRACE(Service_FS, "Read %s %s: offset=0x%llx length=%d address=0x%x", |
| 142 | GetTypeName().c_str(), GetName().c_str(), offset, length, address); | 136 | GetTypeName().c_str(), GetName().c_str(), offset, length, address); |
| 143 | cmd_buff[2] = backend->Read(offset, length, Memory::GetPointer(address)); | 137 | cmd_buff[2] = backend->Read(offset, length, Memory::GetPointer(address)); |
| 144 | break; | 138 | break; |
| @@ -151,7 +145,7 @@ public: | |||
| 151 | u32 length = cmd_buff[3]; | 145 | u32 length = cmd_buff[3]; |
| 152 | u32 flush = cmd_buff[4]; | 146 | u32 flush = cmd_buff[4]; |
| 153 | u32 address = cmd_buff[6]; | 147 | u32 address = cmd_buff[6]; |
| 154 | DEBUG_LOG(KERNEL, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", | 148 | LOG_TRACE(Service_FS, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", |
| 155 | GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); | 149 | GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); |
| 156 | cmd_buff[2] = backend->Write(offset, length, flush, Memory::GetPointer(address)); | 150 | cmd_buff[2] = backend->Write(offset, length, flush, Memory::GetPointer(address)); |
| 157 | break; | 151 | break; |
| @@ -159,7 +153,7 @@ public: | |||
| 159 | 153 | ||
| 160 | case FileCommand::GetSize: | 154 | case FileCommand::GetSize: |
| 161 | { | 155 | { |
| 162 | DEBUG_LOG(KERNEL, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str()); | 156 | LOG_TRACE(Service_FS, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str()); |
| 163 | u64 size = backend->GetSize(); | 157 | u64 size = backend->GetSize(); |
| 164 | cmd_buff[2] = (u32)size; | 158 | cmd_buff[2] = (u32)size; |
| 165 | cmd_buff[3] = size >> 32; | 159 | cmd_buff[3] = size >> 32; |
| @@ -169,7 +163,7 @@ public: | |||
| 169 | case FileCommand::SetSize: | 163 | case FileCommand::SetSize: |
| 170 | { | 164 | { |
| 171 | u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32); | 165 | u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32); |
| 172 | DEBUG_LOG(KERNEL, "SetSize %s %s size=%llu", | 166 | LOG_TRACE(Service_FS, "SetSize %s %s size=%llu", |
| 173 | GetTypeName().c_str(), GetName().c_str(), size); | 167 | GetTypeName().c_str(), GetName().c_str(), size); |
| 174 | backend->SetSize(size); | 168 | backend->SetSize(size); |
| 175 | break; | 169 | break; |
| @@ -177,14 +171,14 @@ public: | |||
| 177 | 171 | ||
| 178 | case FileCommand::Close: | 172 | case FileCommand::Close: |
| 179 | { | 173 | { |
| 180 | DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); | 174 | LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); |
| 181 | Kernel::g_object_pool.Destroy<File>(GetHandle()); | 175 | Kernel::g_object_pool.Destroy<File>(GetHandle()); |
| 182 | break; | 176 | break; |
| 183 | } | 177 | } |
| 184 | 178 | ||
| 185 | // Unknown command... | 179 | // Unknown command... |
| 186 | default: | 180 | default: |
| 187 | ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); | 181 | LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); |
| 188 | ResultCode error = UnimplementedFunction(ErrorModule::FS); | 182 | ResultCode error = UnimplementedFunction(ErrorModule::FS); |
| 189 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. | 183 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. |
| 190 | return error; | 184 | return error; |
| @@ -192,12 +186,6 @@ public: | |||
| 192 | cmd_buff[1] = 0; // No error | 186 | cmd_buff[1] = 0; // No error |
| 193 | return MakeResult<bool>(false); | 187 | return MakeResult<bool>(false); |
| 194 | } | 188 | } |
| 195 | |||
| 196 | ResultVal<bool> WaitSynchronization() override { | ||
| 197 | // TODO(bunnei): ImplementMe | ||
| 198 | ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); | ||
| 199 | return UnimplementedFunction(ErrorModule::FS); | ||
| 200 | } | ||
| 201 | }; | 189 | }; |
| 202 | 190 | ||
| 203 | class Directory : public Object { | 191 | class Directory : public Object { |
| @@ -222,7 +210,7 @@ public: | |||
| 222 | u32 count = cmd_buff[1]; | 210 | u32 count = cmd_buff[1]; |
| 223 | u32 address = cmd_buff[3]; | 211 | u32 address = cmd_buff[3]; |
| 224 | auto entries = reinterpret_cast<FileSys::Entry*>(Memory::GetPointer(address)); | 212 | auto entries = reinterpret_cast<FileSys::Entry*>(Memory::GetPointer(address)); |
| 225 | DEBUG_LOG(KERNEL, "Read %s %s: count=%d", | 213 | LOG_TRACE(Service_FS, "Read %s %s: count=%d", |
| 226 | GetTypeName().c_str(), GetName().c_str(), count); | 214 | GetTypeName().c_str(), GetName().c_str(), count); |
| 227 | 215 | ||
| 228 | // Number of entries actually read | 216 | // Number of entries actually read |
| @@ -232,14 +220,14 @@ public: | |||
| 232 | 220 | ||
| 233 | case DirectoryCommand::Close: | 221 | case DirectoryCommand::Close: |
| 234 | { | 222 | { |
| 235 | DEBUG_LOG(KERNEL, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); | 223 | LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); |
| 236 | Kernel::g_object_pool.Destroy<Directory>(GetHandle()); | 224 | Kernel::g_object_pool.Destroy<Directory>(GetHandle()); |
| 237 | break; | 225 | break; |
| 238 | } | 226 | } |
| 239 | 227 | ||
| 240 | // Unknown command... | 228 | // Unknown command... |
| 241 | default: | 229 | default: |
| 242 | ERROR_LOG(KERNEL, "Unknown command=0x%08X!", cmd); | 230 | LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); |
| 243 | ResultCode error = UnimplementedFunction(ErrorModule::FS); | 231 | ResultCode error = UnimplementedFunction(ErrorModule::FS); |
| 244 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. | 232 | cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. |
| 245 | return error; | 233 | return error; |
| @@ -247,12 +235,6 @@ public: | |||
| 247 | cmd_buff[1] = 0; // No error | 235 | cmd_buff[1] = 0; // No error |
| 248 | return MakeResult<bool>(false); | 236 | return MakeResult<bool>(false); |
| 249 | } | 237 | } |
| 250 | |||
| 251 | ResultVal<bool> WaitSynchronization() override { | ||
| 252 | // TODO(bunnei): ImplementMe | ||
| 253 | ERROR_LOG(OSHLE, "(UNIMPLEMENTED)"); | ||
| 254 | return UnimplementedFunction(ErrorModule::FS); | ||
| 255 | } | ||
| 256 | }; | 238 | }; |
| 257 | 239 | ||
| 258 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 240 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -272,11 +254,11 @@ ResultVal<Handle> OpenArchive(FileSys::Archive::IdCode id_code) { | |||
| 272 | ResultCode CloseArchive(FileSys::Archive::IdCode id_code) { | 254 | ResultCode CloseArchive(FileSys::Archive::IdCode id_code) { |
| 273 | auto itr = g_archive_map.find(id_code); | 255 | auto itr = g_archive_map.find(id_code); |
| 274 | if (itr == g_archive_map.end()) { | 256 | if (itr == g_archive_map.end()) { |
| 275 | ERROR_LOG(KERNEL, "Cannot close archive %d, does not exist!", (int)id_code); | 257 | LOG_ERROR(Service_FS, "Cannot close archive %d, does not exist!", (int)id_code); |
| 276 | return InvalidHandle(ErrorModule::FS); | 258 | return InvalidHandle(ErrorModule::FS); |
| 277 | } | 259 | } |
| 278 | 260 | ||
| 279 | INFO_LOG(KERNEL, "Closed archive %d", (int) id_code); | 261 | LOG_TRACE(Service_FS, "Closed archive %d", (int) id_code); |
| 280 | return RESULT_SUCCESS; | 262 | return RESULT_SUCCESS; |
| 281 | } | 263 | } |
| 282 | 264 | ||
| @@ -288,11 +270,11 @@ ResultCode MountArchive(Archive* archive) { | |||
| 288 | FileSys::Archive::IdCode id_code = archive->backend->GetIdCode(); | 270 | FileSys::Archive::IdCode id_code = archive->backend->GetIdCode(); |
| 289 | ResultVal<Handle> archive_handle = OpenArchive(id_code); | 271 | ResultVal<Handle> archive_handle = OpenArchive(id_code); |
| 290 | if (archive_handle.Succeeded()) { | 272 | if (archive_handle.Succeeded()) { |
| 291 | ERROR_LOG(KERNEL, "Cannot mount two archives with the same ID code! (%d)", (int) id_code); | 273 | LOG_ERROR(Service_FS, "Cannot mount two archives with the same ID code! (%d)", (int) id_code); |
| 292 | return archive_handle.Code(); | 274 | return archive_handle.Code(); |
| 293 | } | 275 | } |
| 294 | g_archive_map[id_code] = archive->GetHandle(); | 276 | g_archive_map[id_code] = archive->GetHandle(); |
| 295 | INFO_LOG(KERNEL, "Mounted archive %s", archive->GetName().c_str()); | 277 | LOG_TRACE(Service_FS, "Mounted archive %s", archive->GetName().c_str()); |
| 296 | return RESULT_SUCCESS; | 278 | return RESULT_SUCCESS; |
| 297 | } | 279 | } |
| 298 | 280 | ||
| @@ -442,7 +424,7 @@ void ArchiveInit() { | |||
| 442 | if (archive->Initialize()) | 424 | if (archive->Initialize()) |
| 443 | CreateArchive(archive, "SDMC"); | 425 | CreateArchive(archive, "SDMC"); |
| 444 | else | 426 | else |
| 445 | ERROR_LOG(KERNEL, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str()); | 427 | LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str()); |
| 446 | } | 428 | } |
| 447 | 429 | ||
| 448 | /// Shutdown archives | 430 | /// Shutdown archives |