1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: hio_SharedMemoryChannel.h 4 5 Copyright (C)2009-2012 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 46347 $ 14 *---------------------------------------------------------------------------*/ 15 16 #ifndef NN_HIO_CTR_HIO_SHAREDMEMORYCHANNEL_H_ 17 #define NN_HIO_CTR_HIO_SHAREDMEMORYCHANNEL_H_ 18 #ifdef NN_SWITCH_ENABLE_HOST_IO 19 20 /* Please see man pages for details 21 22 23 24 25 */ 26 27 28 #include <nn/types.h> 29 30 namespace nn { 31 namespace hio { 32 namespace CTR { 33 34 /* Please see man pages for details 35 36 37 38 39 40 */ 41 class SharedMemoryChannel 42 { 43 private: 44 s32 m_Ch; 45 46 public: 47 /* Please see man pages for details 48 49 */ SharedMemoryChannel()50 SharedMemoryChannel() : m_Ch(-1) {} 51 52 /* Please see man pages for details 53 54 */ ~SharedMemoryChannel()55 ~SharedMemoryChannel() 56 { 57 if( m_Ch >= 0 ) 58 { 59 Close(); 60 } 61 } 62 63 /* Please see man pages for details 64 65 66 67 68 69 70 */ 71 Result Open(int ch, void* pWorkMemory); 72 73 74 /* Please see man pages for details 75 76 77 78 79 */ 80 Result Close(); 81 82 /* Please see man pages for details 83 84 85 86 87 */ 88 size_t GetSpaceSize(); 89 90 91 /* Please see man pages for details 92 93 94 95 96 97 98 99 100 101 */ 102 Result Read(void* buf, size_t length, int offset); 103 104 105 /* Please see man pages for details 106 107 108 109 110 111 112 113 114 115 */ 116 Result Write(const void* buf, size_t length, int offset); 117 }; 118 119 } 120 } 121 } 122 123 124 #endif // ifdef NN_SWITCH_ENABLE_HOST_IO 125 #endif // ifndef NN_HIO_CTR_HIO_SHAREDMEMORYCHANNEL_H_ 126