Commit Graph

227 Commits

Author SHA1 Message Date
yellows8
b50ac5b322
Added ringcon. (#388)
* Added ringcon.
2020-03-24 22:18:56 -04:00
yellows8
f0f21507db
fs/fsdev: Added fsdevMountDeviceSaveData/fsOpen_DeviceSaveData, and minor other adjustments. 2020-03-18 22:33:15 -04:00
fincs
6535d6f871
Remove U64_MAX in favor of using UINT64_MAX 2020-03-16 16:21:33 +01:00
fincs
04214ea441
romfs_dev: fix reading into buffers with device mappable attribute 2020-01-22 00:56:34 +01:00
yellows8
f043307e7f
In __libnx_init_time(), use 'NX' for the tzname instead of the actual timezone-name. Using the original tzname causes issues with certain timezones. Closes #353. 2019-12-19 16:22:45 -05:00
yellows8
5182b57a1d
fs/fs_dev: Added FsFileSystemQueryId_IsValidSignedSystemPartitionOnSdCard, fsFsIsValidSignedSystemPartitionOnSdCard, and fsdevIsValidSignedSystemPartitionOnSdCard. Improved docs. 2019-11-28 18:51:52 -05:00
yellows8
8fe48e8eac
fs/fs_dev/romfs_dev: Updated various types to use s64. Removed the inval param from fsDirRead since it doesn't exist. Renamed fileSize in FsDirectoryEntry to file_size and updated the type. Renamed FsFileSystemQueryType to FsFileSystemQueryId, and renamed FsFileSystemQueryType_SetArchiveBit to FsFileSystemQueryId_SetConcatenationFileAttribute. Renamed fsFsSetArchiveBit to fsFsSetConcatenationFileAttribute. Renamed fsdevSetArchiveBit to fsdevSetConcatenationFileAttribute. Minor other changes. 2019-11-28 14:58:55 -05:00
yellows8
70ddae58ff
acc/nfc/nifm: Removed *SetServiceType and moved the service_type param into the actual {service}Initialize() funcs. Removed *ServiceType_NotInitialized and updated the *ServiceType enum values. Minor other changes / improved nifm docs. 2019-11-18 10:52:46 -05:00
yellows8
f181807215
fs/fs_dev: Updated names to match wiki. Updated param names. Renamed FS_SAVEDATA_CURRENT_PROGRAMID to FS_SAVEDATA_CURRENT_APPLICATIONID. Updated field names in FsSaveDataAttribute, FsSaveDataExtraData, FsSaveDataCreationInfo, and FsSaveDataInfo. Updated names for the enum values for FsSaveDataSpaceId, FsSaveDataType, FsSaveDataFlags, and FsGameCardAttribute. Added FsSaveDataSpaceId_SdUser and FsSaveDataSpaceId_SafeMode. Added FsSaveDataType_SystemBcat. Added FsSaveDataRank. Fixed the name for FsGameCardPartition and added FsGameCardPartition_Logo. Renamed FsBisStorageId to FsBisPartitionId, updated the enum value names for it, and added FsBisPartitionId_SignedSystemPartitionOnSafeMode. Improved docs / minor other changes. 2019-11-16 16:07:10 -05:00
yellows8
c40f8ecac6
Removed includes which are unneeded due to being included elsewhere, etc. Minor improvements. 2019-11-12 12:45:58 -05:00
yellows8
9888df18da
Moved most ncm types into ncm_types.h. Renamed FsStorageId to NcmStorageId, with updated names for some values (now located in ncm_types.h). Various improvements + improved docs. 2019-11-11 18:19:45 -05:00
yellows8
ce570a70f1
romfs_dev: Replaced the romFS_dir()/romFS_file() macros with funcs which have actual bounds-checking, this fixes crashes/hangs when the romfs tables are corrupted. Updated relevant code to handle this / various improvements, and return ENOENT instead of EEXIST where required. 2019-11-11 11:07:46 -05:00
yellows8
4ab50e3752
Use official naming instead of 'title(ID)'. Use 'uid(s)' instead of 'userID(s)'. Updated various struct field names. Improved docs + minor other improvements. 2019-10-30 10:38:05 -04:00
fincs
f062c6ecab
resolver: Clean up and simplify gethostbyname/gethostbyaddr/getnameinfo 2019-10-28 14:04:25 +01:00
fincs
0378d553e0
resolver: Minor codestyle fixes 2019-10-28 13:00:07 +01:00
fincs
1e0bcfbf87
resolver: Add commands to configure behavior (most not implemented) 2019-10-28 12:36:43 +01:00
fincs
26f620dc0e
Split up socket.c + work in progress changes:
- DNS stuff moved to runtime/resolver.c & .h
- Address manipulation functions moved to runtime/util/inet_addr.c
- Removed sfdnsres/nifm handling in runtime/devices/socket.c
- Renamed socketGetLastBsdResult to socketGetLastResult
- Renamed socketGetLastSfdnsresResult to resolverGetLastResult
- gethostid now inits/deinits nifm as needed
- sfdnsres related configuration gone from SocketInitConfig
- Fixed bug in addrinfo deserialization
- getaddrinfo rewritten, hints can now be NULL
- TODO: add back a way to control service discovery/cancel handle
2019-10-28 12:36:29 +01:00
fincs
1592b2892f
sfdnsres: Major rewrite using new-ipc, fixed numerous IPC bugs, removed phantom commands 2019-10-27 17:25:53 +01:00
fincs
5340c7d7dc
Add multithreaded BSD/socket support; revise BSD service type handling so that bsd:u is the default (since it has 22 worker threads as opposed to bsd:s's 11) 2019-10-26 17:26:04 +02:00
fincs
4ab2384449
fatal: Rename functions/types to match official names more closely 2019-10-24 23:25:07 +02:00
fincs
d025041e3d
sm: Introduce and use SmServiceName struct (with better codegen) 2019-10-22 20:10:52 +02:00
fincs
9e83f82a62
Enhance fsOpen_SystemSaveData/fsdevMountSystemSaveData 2019-10-21 21:15:40 +02:00
fincs
47b0403333
Pass plain AccountUid inputs by value instead of by non-const pointer 2019-10-21 16:57:01 +02:00
fincs
13fbde91b0
fsdev: Added fsdevMountSaveData/SystemSaveData wrappers 2019-10-21 12:38:18 +02:00
fincs
54f6fa5420
fs: Use official method names, document min sysver, correct a few parameters 2019-10-21 12:37:38 +02:00
fincs
c77b88d868
Major cleanup and refactor of fsdev and romfsdev, see details:
fsdev:
- Removed fsdevGetDefaultFileSystem and default-fs handling
- Refactored CWD support to have (dynamically allocated) per-device CWDs
  (CWD support as a whole can be turned off with __nx_fsdev_support_cwd)
- Optimized calls by passing pointer to device through r->deviceData
- Use the per-thread path buffer directly as the argument to FS functions
- Removed redundant cross-device check in fsdev_rename
- Fixed string comparison logic in fsdevFindDevice
- fsdev_fixpath now accepts an input device in order to skip device
  lookup (extensively used along with r->deviceData)
- Mounting a filesystem now automatically sets the default device
  if there wasn't any previous default device (or if it's stdnull)
- fsdevMountSdmc no longer sets cwd to the folder containing the
  executable - this logic was moved to a new internal function
  called on startup by default (and it is now disabled for NSOs)
- Other miscellaneous optimizations

romfsdev:
- Cleaned up romfsMount* functions, removed unused/unnecessary logic
- Changed romfsMount* functions to return real result codes
- Renamed romfsMount to romfsMountSelf and improved documentation
- Removed romfsInitFromFile and romfsInitFromStorage (use Mount instead)
- Added documentation for romfsInit and romfsExit
2019-10-20 22:22:04 +02:00
fincs
26a0ee4af3
fsdev/romfsdev: Reduce TLS usage by sharing the path buffer 2019-10-20 02:48:04 +02:00
SciresM
415adf5b93 threads: support using existing mem as stack (#336) 2019-10-19 04:25:23 +02:00
fincs
69a63bbee8
fsdev: Reduce TLS footprint for rarely used codepaths 2019-10-19 04:00:50 +02:00
fincs
3c610fb2cb
fsdev: Allow directory entry cache size to be configured dynamically 2019-10-18 21:23:11 +02:00
yellows8
e82819d8a4
usbds: Updated for new-ipc. Added sysver checking. Updated the intf_num param type for usbDsRegisterInterfaceEx, likewise with intf_num fields used elsewhere. Renamed the Service 'h' field in UsbDsInterface/UsbDsEndpoint to 's'. Minor improvements + improved docs.
usbComms: Fixed locking issue which caused a hang in usbCommsInitialize*() when init fails.
2019-10-17 17:34:36 -04:00
yellows8
95f91c431c
account: Updated for new-ipc. Renamed the username field in AccountProfileBase to nickname. Fixed various param types, and also removed the output bool from accountGetLastOpenedUser. Added struct AccountUid for proper userIDs, which replaces u128-userIDs. Added accountUidIsValid. Added accountSetServiceType()/AccountServiceType. Improved docs and minor improvements.
env: Updated UserIdStorage handling for using AccountUid.
2019-10-08 15:41:18 -04:00
yellows8
1c334bafb9
set: Updated for new-ipc. Changed the type of the Language param for setMakeLanguage*() from s32 to SetLanguage. Added size_out param to setsysGetSettingsItemValue which was previously missing. Minor param name adjustment for setsysBindFatalDirtyFlagEvent. Improved docs. 2019-10-04 14:41:10 -04:00
fincs
b30b567228
fsdev: Convert time into proper POSIX UTC timestamps (FS reports local time instead) 2019-09-22 18:14:10 +02:00
fincs
ecbc77840e
fs: Update names of enum/flag types for style consistency and correctness 2019-09-21 19:54:21 +02:00
fincs
77888f8b1f
fs: Use new IPC interface + fixes, see details:
- Argument types corrected to better reflect their actual types
  (mostly several incorrect instances of size_t were changed to u64)
- Const correctness fixes
- fsEventNotifierGetEventHandle changed to output an Event (with
  user configurable autoclear) instead of a raw Handle
2019-09-21 16:27:15 +02:00
fincs
8a0aef8824
Fix new compiler warnings raised by GCC 9.x 2019-09-21 00:58:33 +02:00
friedkeenan
fdb1605fc5 Require whole mount name to match when finding a romfs (#324) 2019-09-02 21:22:49 +02:00
fincs
01d648e7ed Add support for new homebrew ABI keys + loader info 2019-07-29 21:17:09 +02:00
SciresM
e1a6a463c2 Add enums for GetInfo/GetSystemInfo (#292) 2019-06-22 00:05:56 +02:00
yellows8
006ebc0633
Fixed romfsUnmount RemoveDevice handling. 2019-06-13 19:41:35 -04:00
Pablo Curiel
e3d7b12c96 Remove RomFS devoptab device on unmount. 2019-06-08 17:16:55 +02:00
Michael Scire
ac9d76f373 fs: fix file/storage API, add fsdevCreateFile, add fsOpenFileSystemWithPatch. 2019-06-03 14:48:45 -04:00
yellows8
90620daf05
Added romfsMountFromCurrentProcess(). 2019-05-17 11:15:43 -04:00
Michael Scire
39db25c81d romfs_dev: fix unmounting/corruption when mounting multiple. 2019-05-09 12:42:15 +02:00
SciresM
e114a361be fsdev: add way of getting last returned result. (#276)
Adds fsdevGetLastResult, which returns a thread local Result updated by every call to fsdev_translate_error.

Also changes fsdev_translate_error to return EIO instead of raw results, when not translatable.
2019-05-08 16:44:17 +02:00
Adubbz
1d3e208807 Added fsdevDeleteDirectoryRecursively 2019-05-05 18:26:08 +02:00
Ezekiel Bethel
26458fc1e8 add 0x402 (path exists) => EEXIST mapping in fs_dev 2019-04-09 22:16:34 -04:00
fincs
a469a68b20 Add custom extension to MOD0 header & a few other useful symbols 2019-04-08 16:36:45 +02:00
yellows8
fd9e02b271
Added romfsMountFromFsdev and fsdevTranslatePath. Internal romfs_dev improvements. 2019-03-29 19:49:08 -04:00
fincs
56471670ee Remove old C11 threads implementation 2019-03-29 18:40:26 +01:00
fincs
9d9b2efe29 devkitA64 r13 support changes, including pthread support 2019-03-29 18:40:26 +01:00
fincs
626b07fac8 Implement TLS slot support (with destructors) 2019-03-29 18:40:26 +01:00
Michael Scire
5575966d0c fix fsdev bug 2019-03-25 00:02:18 +01:00
Michael Scire
1bea504732 Added fsOpenDataStorageByDataId and romfsMountFromDataArchive 2019-03-25 00:02:18 +01:00
Michael Scire
43128b613b romfs: refactor to allow specifying mount name 2019-03-25 00:02:18 +01:00
yellows8
81ce04eb7b In nxlinkStdio(), return sock on success instead of ret. 2019-02-27 19:15:31 -05:00
fincs
11b7bece4a Change all services except fatal to use hosversion* instead of kernelAboveXYZ 2019-02-18 21:48:49 +01:00
fincs
61cc738730 Introduce hosversion.h - HOS version detection utilities
- Simplify kernel/detect.h logic; introduce detectKernelVersion()
- Use set:sys (if available) during __appInit in order to initialize
  the current HOS version
2019-02-18 21:48:41 +01:00
Cpasjuste
855a719728 c11-threads: return thrd_timedout on cnd_timedwait timeout (#232) 2019-01-09 13:33:23 +01:00
fincs
5039c0815e console_sw: Switch to PIXEL_FORMAT_RGB_565, optimize scrollWindow 2018-12-19 19:33:31 +01:00
fincs
1b18a3b056 console_sw: Use Framebuffer object instead of old gfx api. Moved RGBA8/_MAXALPHA to framebuffer.h. 2018-12-19 19:33:31 +01:00
fincs
3a77a7ace8 Introduce nwindowGetDefault 2018-12-19 19:33:31 +01:00
yellows8
725ac9f00a Moved usb code specific to usbds into seperate .c/.h. 2018-11-28 17:34:53 -05:00
yellows8
36bed9f8fc Added support for getting file timestamps via 3.0.0+ fsFsGetFileTimeStampRaw, *stat() timestamps are now set when fsFsGetFileTimeStampRaw is successful. This is now used in fsdev_open() for supporting fstat. The sysver is now checked in fsFsCleanDirectoryRecursively(). Closes #204. 2018-11-20 14:22:19 -05:00
yellows8
12ee6e502e Fixed register corruption in crt0 introduced by the exception commit. Only handle exceptions when __libnx_exception_handler is defined by the user, and updated comments. 2018-11-14 20:55:17 -05:00
yellows8
5e69f760fb Added support for exception-handling. 2018-11-14 16:17:02 -05:00
SciresM
e19765445d fs: Add fsFsQueryEntry (and fsFsSetArchiveBit helper) (#202)
* fs: Add fsFsSetArchiveBit

* Add fsdevSetArchiveBit wrapper
2018-11-09 22:03:47 -05:00
yellows8
318562d13b Init/exit nifm in socketInitialize/socketExit, the user app no longer has to manually handle this when using gethostid/gethostname. Use domains for nifm. Style adjustments in nifm.c. 2018-10-23 14:04:58 -04:00
yellows8
cfbc3e9278 Added usbCommsSetErrorHandling, don't throw fatalSimple for usbComms by default. 2018-10-19 12:34:17 -04:00
fincs
8e1736c480 Add RandomSeed (14) homebrew ABI key and related handling 2018-10-17 17:17:05 +02:00
TuxSH
052fb34397 Reduce usage of malloc in select and poll. Fix poll not acceping -1 fds 2018-10-16 18:53:05 -04:00
yellows8
52686826d1 Added fsdevGetDeviceFileSystem(). 2018-10-12 22:13:14 -04:00
SciresM
347e3b3156 Refactor usb:ds, add 5.0.0+ support to usbComms. (#181)
* Refactor usb:ds, add support for 5.0.0+. Closes #109.
2018-10-11 15:35:22 -04:00
Thog
8178c0fa45 _socketDeserializeHostent: fix usage of uninitialized h_name 2018-10-08 21:44:30 -04:00
fincs
420d5d4e61 C11 thread support: address standard compilance issues
Also fixes #158
2018-10-06 22:00:31 +02:00
fincs
1563df3921 Refactor console device, see details:
- Added ConsoleRenderer interface, which abstracts all relevant
  operations needed to set up and write characters to a text mode display
- ConsoleFont now has tileWidth/tileHeight parameters
- PrintConsole now holds a pointer to a ConsoleRenderer
- Added consoleExit for deinitializing the console
- Added consoleUpdate for updating the display every frame
- Corrected lots of obsolete/outdated comments
- Separated console software renderer into its own file (console_sw.c)
- Added getDefaultConsoleRenderer weak function, for selecting the
  default console renderer when none (NULL) is specified in PrintConsole
- Software renderer now takes care of gfxInitDefault/gfxExit
- All these changes are backwards compatible with older programs because:
  - gfxInitDefault has double-init protection
  - Old programs don't call consoleUpdate/Exit, but their implementation
    in the software renderer is identical to what old programs were
    already doing anyway
2018-10-06 16:48:03 +02:00
yellows8
4fb364060c Added support for timezones, hence localtime() will now return actual localtime. Added timeToCalendarTimeWithMyRule and TimeCalendarTime/TimeCalendarAdditionalInfo, which are used for timezones support. 2018-10-05 19:59:24 -04:00
yellows8
b4859873ec Added env AppletFlags handling. Don't enter the msg-loop for AppletType_Application when the output from _appletGetCurrentFocusState is already 1. This fixes the hang issue with AppletType_Application where applet init with AppletType_Application was previously done. Moved AppletType_*Application checks into a dedicated function which also checks for AppletType_SystemApplication, hence some of these funcs which didn't check for AppletType_SystemApplication now support it. 2018-10-04 18:06:00 -04:00
yellows8
96dce1a8b6 In __libnx_gtod set errno to EIO instead of EINVAL when __boottime is invalid due to timeGetCurrentTime() failing during time init, and added this to __libnx_clock_gettime. Set errno to ENOSYS in __libnx_clock_settime. 2018-10-03 20:55:58 -04:00
yellows8
0b1b7039ca Changed the value of TimeType_Default to TimeType_UserSystemClock. When timeGetCurrentTime fails where __nx_time_type isn't TimeType_Default, call it again with TimeType_Default. 2018-10-03 19:48:33 -04:00
yellows8
16bbf3411e Added automatic process exit handling with applet cmds, see __nx_applet_exit_mode. appletSelfExit is no longer user-accessible, see __nx_applet_exit_mode instead. Added envSetExitFuncPtr. Added disabled _appletSetTerminateResult func. 2018-10-03 19:04:48 -04:00
fincs
eb11e25dc5 Add Module_HomebrewAbi/Loader. Reassign Module_LibnxBinder, as it inadvertently collided with Module_HomebrewLoader. 2018-09-27 21:03:29 +02:00
fincs
81d56a9e23 console: disable forced flush/swap/vblank due to performance reasons 2018-09-08 14:19:24 +02:00
fincs
7f8b6af64c runtime/newlib.c: use armGetSystemTick instead of svcGetSystemTick 2018-08-31 13:05:23 +02:00
plutooo
d8bb563546 Renamed gfx/ to display/ 2018-08-31 13:05:21 +02:00
fincs
80439a186b Add MOD0 header to crt0 2018-08-31 13:05:21 +02:00
Lioncash
d3f388d2c8 socket: Correct missing break within _socketParseBsdResult() 2018-08-09 14:53:41 +02:00
fincs
f3b530cea3 C11 threads: enable preemptive scheduler and load balancing 2018-08-06 17:59:51 +02:00
fincs
b181d725ac Use revised CondVar API in C11 threads impl 2018-08-05 14:32:10 +02:00
fincs
d255fe730b Experimental partial C11 threads support 2018-08-05 13:23:08 +02:00
Dave Murphy
be509f62ce return through libc exit rather than __libnx_exit directly (#139) 2018-07-26 18:01:40 +02:00
Dave Murphy
aa3c35e6e3 adjust fsdev_fixpath for cwd changes (#132)
* adjust fsdev_fixpath for cwd changes
2018-07-19 11:31:51 -04:00
Dave Murphy
35be7ac772 allow user additions to init/exit code (#124)
* allow user additions to init/exit code
2018-06-25 12:42:52 -04:00
Dave Murphy
8b2b12b454 fix _IOC cast 2018-06-14 18:26:29 -04:00
Dave Murphy
4e4d2fe3c6 translate horizon errno to newlib errno 2018-06-14 18:25:52 -04:00
Dave Murphy
70cd9e017d fix ioctl 2018-06-14 01:51:36 +02:00
Dave Murphy
9860ad331c implement nanosleep 2018-06-14 00:49:20 +02:00
jarulo
8b793729fc Fix inet_pton4 2018-06-12 13:08:27 +02:00
Somebody Whoisbored
ad4af954c2 Added nifm service (#110)
* Added nifm service
* Properly implemented gethostid
* Implemented gethostname
2018-06-07 18:00:51 -04:00