My Project
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
am.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*
4  Requires access to "am:net" or "am:u" service
5 */
6 
7 Result amInit();
8 Result amExit();
9 
10 /* AM_GetTitleCount()
11 About: Gets the number of titles for a given mediatype
12 
13  mediatype mediatype to get titles from
14  count ptr to store title count
15 */
16 Result AM_GetTitleCount(u8 mediatype, u32 *count);
17 
18 /* AM_GetTitleList()
19 About: Writes a titleid list for a mediatype to a buffer
20 
21  mediatype mediatype to get list from
22  count number of titleids to get
23  buffer buffer to write titleids to
24 */
25 Result AM_GetTitleList(u8 mediatype, u32 count, void *buffer);
26 
27 /* AM_GetDeviceId()
28 About: Gets a 32bit device id, it's used for some key slot inits
29 
30  device_id ptr to where the device id is written to
31 */
32 Result AM_GetDeviceId(u32 *deviceid);
33 
34 /**** Title Install Methods ****/
35 /* AM_StartCiaInstall()
36 About: Inits CIA install process, the returned ciahandle is where the data for CIA should be written to
37 
38  mediatype mediatype to install CIA to
39  ciahandle ptr to where the handle should be written to
40 */
41 Result AM_StartCiaInstall(u8 mediatype, Handle *ciahandle);
42 
43 /* AM_StartDlpChildCiaInstall()
44 About: Inits CIA install process, the returned ciahandle is where the data for CIA should be written to
45 Note: This is for installing DLP CIAs only, mediatype is hardcoded to be NAND
46 
47  ciahandle ptr to where the handle should be written to
48 */
50 
51 /* AM_CancelCIAInstall()
52 About: Abort CIA install process
53 
54  ciahandle ptr to cia Handle provided by AM
55 */
57 
58 /* AM_FinishCiaInstall()
59 About: Once all data is written to the cia handle, this command signals AM to proceed with CIA install.
60 Note: AM closes the cia handle provided here
61 
62  mediatype same mediatype specified ciahandle was obtained
63  ciahandle ptr to cia Handle provided by AM
64 */
65 Result AM_FinishCiaInstall(u8 mediatype, Handle *ciahandle);
66 
67 /**** Title Delete Methods ****/
68 /* AM_DeleteTitle()
69 About: Deletes any title on NAND/SDMC
70 Note: AM closes the cia handle provided here
71 
72  mediatype mediatype of title
73  titleid title id of title
74 */
75 Result AM_DeleteTitle(u8 mediatype, u64 titleid);
76 
77 /* AM_DeleteAppTitle()
78 About: Deletes any title on NAND/SDMC
79 Note: If the title has the system category bit set, this will fail
80 
81  mediatype mediatype of title
82  titleid title id of title
83 */
84 Result AM_DeleteAppTitle(u8 mediatype, u64 titleid);
85 
86 /* AM_InstallFIRM()
87 About: Installs FIRM to NAND (firm0:/ & firm1:/) from a CXI
88 Note: The title must have the uniqueid: 0x00000, otherwise this will fail.
89 
90  mediatype mediatype of title
91  titleid title id of title
92 */
93 Result AM_InstallFIRM(u8 mediatype, u64 titleid);
Result amInit()
Definition: am.c:6
s32 Result
Definition: types.h:42
Result AM_DeleteAppTitle(u8 mediatype, u64 titleid)
Definition: am.c:136
Result AM_GetTitleList(u8 mediatype, u32 count, void *buffer)
Definition: am.c:34
Result amExit()
Definition: am.c:14
u32 Handle
Definition: types.h:41
Result AM_DeleteTitle(u8 mediatype, u64 titleid)
Definition: am.c:121
Result AM_CancelCIAInstall(Handle *ciahandle)
Definition: am.c:93
uint8_t u8
Definition: types.h:21
uint64_t u64
Definition: types.h:24
Result AM_GetTitleCount(u8 mediatype, u32 *count)
Definition: am.c:19
uint32_t u32
Definition: types.h:23
Result AM_FinishCiaInstall(u8 mediatype, Handle *ciahandle)
Definition: am.c:107
Result AM_InstallFIRM(u8 mediatype, u64 titleid)
Definition: am.c:151
Result AM_StartCiaInstall(u8 mediatype, Handle *ciahandle)
Definition: am.c:64
Result AM_StartDlpChildCiaInstall(Handle *ciahandle)
Definition: am.c:79
Result AM_GetDeviceId(u32 *deviceid)
Definition: am.c:50