It is SwIPC's (github.com/reswitched/SwIPC, ISC), with the conventions below.
# comments start with # (// and /* */ work too)
type nn::account::Uid = bytes<0x10, 8>; # bytes<size[, alignment]>
type nn::account::ProfileDigest = bytes<0x10>;
type nn::account::profile::ProfileBase = struct { # natural alignment, like the SDK's struct
nn::account::Uid uid;
u64 last_edit_timestamp;
bytes<0x20> nickname;
};
interface nn::account::IAccountServiceForApplication is acc:u0, acc:u1, acc:su {
[0] GetUserCount() -> i32 count;
[2] ListAllUsers(array<nn::account::Uid, 0xa> users);
[5] GetProfile(nn::account::Uid uid) -> object<nn::account::profile::IProfile> profile;
@stub [6] GetProfileDigest(nn::account::Uid uid) -> nn::account::ProfileDigest digest;
[51] TrySelectUserWithoutInteraction(b8 is_network_service_account_required) -> nn::account::Uid uid;
}
is lists the service names the interface is served
as (sm's names are 8 bytes at most, and each is served by one interface). Every argument and output has a name, but
pid and aruid may go without. Argument, field and command names become C names, so C keywords, :: and the
generated names (a command dispatch, new or register, a field padN_, an argument self) are refused. A
struct is written in a type definition.u8 to u64, i8 to i64 (or s8 to s64), b8 (or bool), f32, f64, bytes<N[, A]>, T[N],
struct {...}, and names given with type. A type is defined before it is used. Types more than one file uses
are in hle/services/types.swipc, which comes first in every list of the runtime's .swipc files, and in every
test's that uses its types.pid is the client's process id (ClientProcessId): an 8 byte slot in the raw data whose value the kernel gives (0
when the client sent none). It is one slot: SwIPC's (u64, pid) is written pid here. aruid is
ClientAppletResourceUserId: the same slot, whose raw value the handler gets. Both are inputs, at most one of the two
per command, and neither is a field, an element or a type's name.buffer<T, attributes[, size]> and array<T, attributes>. The
attributes are the numeric BufferAttribute: In 1, Out 2, MapAlias 4, Pointer 8, FixedSize 0x10, AutoSelect 0x20,
NonSecure 0x40, NonDevice 0x80. So 5 is an A buffer, 6 B, 9 X, 0xa C, 0x19 and 0x1a fixed-size X and C, 0x21 and
0x22 AutoSelect, 0x46 a NonSecure B. A FixedSize buffer reaches its handler with the type's size (or the given
size), or the client's if that is smaller, as sf gives the handler the type's size.object<I> is an interface object (I is declared in some .swipc file, with no commands if none is served),
handle<copy, kind> and handle<move, kind> a handle. A move handle is only an output: the kernel refuses a request
that carries one, so the generator refuses one among a command's inputs.@stub before a command: the generated code answers it with success and zeros, and there is no handler. A command
that gives an object or a handle can't be a stub. @unsorted before a command keeps its raw arguments in
declaration order (see the layout). @fallback(function) before an interface names the C function that answers the
commands it doesn't declare, int function(SvcObj* self, IpcCtx* c): quiet_ok (success, silent), ipc_unknown
(sf's UnknownCommandId, what the console answers), or one of the service's own, static in its file (bsd answers
EOPNOTSUPP). Without it stub_ok answers success and logs the command the first three times. @version(...) and
@undocumented are accepted and ignored.Made from docs/platforms/nx/ipc.md at 69237645142c. GPL-3.0-or-later.