Commit Graph

47 Commits

Author SHA1 Message Date
Lioncash d9917dd09c lm: Resolve -Wextra-semi warning
Resolves a trivial warning with clang.
2021-04-23 09:20:54 -04:00
Chloe Marcec 937aa8908b lm: Fix ReadLeb128
Fixes assertion on Bloodstained Ritual of the Night.

We would over read sometimes, this is fixed by checking if the top bit is set in the first iteration. We also lock the loop off to be only the max size of the type we can fit. Finally we changed an incorrect print of "DEBUG" to "TRACE" to reflect the proper log severity
2021-02-07 23:52:56 +11:00
Chloe Marcec 3aa402b373 Print Process ID and Thread ID as hex 2021-01-25 02:47:40 +11:00
Chloe Marcec 1a88d8b4e6 Clamp string reads to buffer size 2021-01-23 18:24:57 +11:00
Chloe Marcec 4b0d52ae64 Mark DestinationToString as static 2021-01-20 18:42:39 +11:00
Chloe Marcec c9f841adfd Mark LogPacketHeaderEntry hash as noexcept 2021-01-20 18:35:58 +11:00
Chloe Marcec 5cbbf4f865 lm: Recode LM service
Rework the service to spit out to logs instead of a seperate file as well as fix any crashes caused by lm.
2021-01-20 18:25:15 +11:00
Lioncash 8f135703dc core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
2020-12-07 23:02:23 -05:00
Lioncash 346271b80b service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
2020-11-26 20:03:11 -05:00
Lioncash e7fe020ace ipc_helpers: Remove usage of the global system instance
Resolves numerous deprecation warnings throughout the codebase due to
inclusion of this header. Now building core should be significantly less
noisy (and also relying on less global state).

This also uncovered quite a few modules that were relying on indirect
includes, which have also been fixed.
2020-11-08 15:58:11 -05:00
bunnei 5b9e69e7fe core: memory: Move to Core::Memory namespace.
- helpful to disambiguate Kernel::Memory namespace.
2020-04-17 00:59:28 -04:00
Lioncash cc3d6fdf73 core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory class
With all of the trivial parts of the memory interface moved over, we can
get right into moving over the bits that are used.

Note that this does require the use of GetInstance from the global
system instance to be used within hle_ipc.cpp and the gdbstub. This is
fine for the time being, as they both already rely on the global system
instance in other functions. These will be removed in a change directed
at both of these respectively.

For now, it's sufficient, as it still accomplishes the goal of
de-globalizing the memory code.
2019-11-26 21:55:39 -05:00
Lioncash e04aeb9531 core: Prepare various classes for memory read/write migration
Amends a few interfaces to be able to handle the migration over to the
new Memory class by passing the class by reference as a function
parameter where necessary.

Notably, within the filesystem services, this eliminates two ReadBlock()
calls by using the helper functions of HLERequestContext to do that for
us.
2019-11-26 21:55:37 -05:00
Zach Hilman 7b5b8db19c lm: Rename Initialize to Log and implement with manager/reporter
Allows saving and clearer output of data.
2019-09-22 12:34:55 -04:00
Zach Hilman 2fa697bb7c core: Add LM::Manager to system
Allows centralized control over logging mechanisms.
2019-09-22 12:34:55 -04:00
Weiyi Wang b10f12b462 remove all occurance of specifying endianness inside BitField
This commit it automatically generated by command in zsh:
sed -i -- 's/BitField<\(.*\)_le>/BitField<\1>/g' **/*(D.)

BitField is now aware to endianness and default to little endian. It expects a value representation type without storage specification for its template parameter.
2019-02-06 18:13:45 +01:00
David Marcec 5ae0d6cba2 Changed logging to be "Log before execution", Added more error logging, all services should now log on some level 2018-11-26 17:06:13 +11:00
Lioncash 5508ceb0eb lm: Implement SetDestination by doing nothing
This service function was likely intended to be a way to redirect where
the output of a log went. e.g. Firing a log over a network, dumping over
a tunneling session, etc.

Given we always want to see the log and not change its output. It's one
of the lucky service functions where the easiest implementation is to
just do nothing at all and return success.
2018-11-19 18:09:40 -05:00
fearlessTobi 1190ea6ddb Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash 6784110323 lm: Use LOG_DEBUG for printing out trace logs
Using LOG_TRACE here isn't a good idea because LOG_TRACE is only enabled
when yuzu is compiled in debug mode. Debug mode is also quite slow, and
so we're potentially throwing away logging messages that can provide
value when trying to boot games.
2018-08-15 01:07:41 -04:00
Lioncash 1da6859863 lm: Handle threads and modules within the logger
The thread field serves to indicate which thread a log is related to and
provides the length of the thread's name, so we can print that out,
ditto for modules.

Now we can know what threads are potentially spawning off logging
messages (for example Lydie & Suelle bounces between MainThread and
LoadingThread when initializing the game).
2018-08-15 01:05:50 -04:00
Lioncash 732fe76a41 lm: Amend name of ILogger
Previously this was being registered with the name "Logger". While we're
at it, also change the name of the class to match it.
2018-08-01 17:08:44 -04:00
Lioncash 6570f0cd5c lm: Move LM's class declaration into the cpp file
This isn't used directly outside of this translation unit, so we can
hide it from external use.
2018-07-25 22:40:16 -04:00
Lioncash 24db60566b lm: Amend names of Initialize() in Logger and Initialize() in LM
Amends these to match the information on Switch Brew.
2018-07-25 22:39:39 -04:00
Lioncash a35847e520 lm: Add missing function entry to Logger's function table 2018-07-25 22:26:32 -04:00
James Rowe e159c550d8 Rename logging macro back to LOG_* 2018-07-02 21:45:47 -04:00
Lioncash afe7828f4b lm: Move logging macros over to new fmt-compatible ones 2018-04-24 12:00:56 -04:00
Lioncash 6d94dd21a5 service: Use nested namespace specifiers where applicable
Tidies up namespace declarations
2018-04-19 22:20:28 -04:00
mailwl f22a8923cc Service/lm: add support to multiline logs 2018-02-13 09:44:53 +03:00
bunnei 9f14ebbd89 logger: Add LM service logging category. 2018-02-04 22:41:55 -05:00
bunnei e7bad17a87 lm: Ensure log string is non-empty before checking back(). 2018-02-04 22:36:57 -05:00
bunnei f328cb2c7c hle: Rename RequestBuilder to ResponseBuilder. 2018-01-24 22:24:10 -05:00
bunnei 427b97e60c service: Fix all incorrect IPC response headers. 2018-01-24 22:21:33 -05:00
Subv aec193732c Services: Added a todo about returning interfaces as domain objects in lm, hid and time. 2018-01-22 20:40:43 -05:00
Subv 3541a04d4d LM: Don't create an unnecessary port in Initialize. 2018-01-22 17:35:40 -05:00
bunnei 93e711daf1 lm: Minor logging fix to skip a byte. 2018-01-18 00:08:38 -05:00
bunnei 2d7ec3bbe0 lm: Fix IPC header for Initialize. 2018-01-14 21:45:06 -05:00
bunnei 182548ec86 yuzu: Update license text to be consistent across project. 2018-01-13 16:22:39 -05:00
Subv 9de1929da9 Services: Allow lm to log single-character messages. 2018-01-10 00:41:29 -05:00
Subv fd93b1e0ef IPC Cleanup: Remove 3DS-specific code and translate copy, move and domain objects in IPC requests.
Popping objects from the buffer is still not implemented.
2018-01-07 17:11:47 -05:00
bunnei 718c77f373 lm: Assert on unsupported multi-message. 2018-01-06 14:41:56 -05:00
bunnei 1941e021bc lm: Improve Log() to format a useful string. 2018-01-05 00:45:13 -05:00
bunnei 82fb80da76 service: Clean up apm/lm/applet_oe/controller/sm ctor/dtor. 2017-12-28 15:27:30 -05:00
bunnei bb50d29ca9 lm: Implement lm::Initialize and Logger::log. 2017-10-18 21:41:24 -04:00
bunnei be299c7636 hle: Implement ConvertSessionToDomain, various cleanups. 2017-10-15 01:24:22 -04:00
bunnei 9ce5a90aa6 hle: Add service stubs for apm and appletOE. 2017-10-14 22:50:04 -04:00
bunnei 2ea8867549 hle: Initial implementation of NX service framework and IPC. 2017-10-14 22:18:42 -04:00