00001 #ifndef MOC_INTERNAL_GET_DATA_H_ 00002 #define MOC_INTERNAL_GET_DATA_H_ 00003 00004 #include <stdint.h> 00005 #include "../../moc.h" 00006 00007 /** 00008 * \addtogroup internal_p2p_dma 00009 **/ 00010 //@{ 00011 /** 00012 * @name SPU-only 00013 **/ 00014 //@{ 00015 00016 00017 /** 00018 * Internal wrapper-function for a blocking DMA-get operation. 00019 * Data can be of any size, constraints of low-level DMA-functions 00020 * are dealt by this function. 00021 * However data-addresses have to be at least 16-byte aligned. 00022 * 00023 * This function actually always reads a multiple of 16 from the source, 00024 * but copies only size bytes of it to target. This means however that up 00025 * to 15 bytes are read from an invalid location. As it is never written to 00026 * them this should always be safe. 00027 * 00028 * @param target \b in ls-address of buffer 00029 * @param source \b in ea-address of data 00030 * @param size \b in size of data in byte 00031 * @return 0 when success otherwise error-code 00032 **/ 00033 int IMOC_get_data(void* target, uint64_t source, uint32_t size); 00034 00035 00036 /** 00037 * Internal wrapper-function for a blocking DMA-put operation. 00038 * Data-size should be a multiple of 16 because of low-level constraints, but 00039 * there is no upper limit of transfer-size. 00040 * Data-addresses have to be at least 16-byte aligned. 00041 * 00042 * This function actually always reads a multiple of 16 from the source, and copies 00043 * it to target. This means however that up to 15 bytes are written to and invalid 00044 * location, so if one wants to use it with invalid sizes precautions have to be taken 00045 * in order to make it safe. 00046 * 00047 * @param source \b in ls-address of data 00048 * @param target \b in ea-address of buffer 00049 * @param size \b in size of data in byte 00050 * @return 0 when success otherwise error-code 00051 **/ 00052 int IMOC_put_data(void* source, uint64_t target, uint32_t size); 00053 00054 /** 00055 * Internal wrapper-function for a non-blocking DMA-get operation. 00056 * Data can be of any size, constraints of low-level DMA-functions 00057 * are dealt by this function. 00058 * However data-addresses have to be at least 16-byte aligned. 00059 * 00060 * This function actually always reads a multiple of 16 from the source, 00061 * but copies only size bytes of it to target. This means however that up 00062 * to 15 bytes are read from an invalid location. As it is never written to 00063 * them this should always be safe. 00064 * 00065 * @param target \b in ls-address of buffer 00066 * @param source \b in ea-address of data 00067 * @param size \b in size of data in byte 00068 * @param request \b out request-handle 00069 * @return 0 when success otherwise error-code 00070 **/ 00071 int IMOC_iget_data(void* target, uint64_t source, uint32_t size, imoc_dma_request* request); 00072 00073 /** 00074 * Internal wrapper-function for a blocking DMA-put operation. 00075 * Data-size should be a multiple of 16 because of low-level constraints, but 00076 * there is no upper limit of transfer-size. 00077 * Data-addresses have to be at least 16-byte aligned. 00078 * 00079 * This function actually always reads a multiple of 16 from the source, and copies 00080 * it to target. This means however that up to 15 bytes are written to and invalid 00081 * location, so if one wants to use it with invalid sizes precautions have to be taken 00082 * in order to make it safe. 00083 * 00084 * @param source \b in ls-address of data 00085 * @param target \b in ea-address of buffer 00086 * @param size \b in size of data in byte 00087 * @param request \b out request-handle 00088 * @return 0 when success otherwise error-code 00089 **/ 00090 int IMOC_iput_data(void* source, uint64_t target, uint32_t size, imoc_dma_request* request); 00091 00092 00093 /** 00094 * Waits till a IMOC_iget_data or IMOC_iput_data is completed. 00095 * 00096 * @param request \b in request-handle 00097 * @return 0 when success otherwise error-code 00098 **/ 00099 int IMOC_wait_dma(imoc_dma_request* request); 00100 00101 /** 00102 * Tests if a IMOC_iget_data or IMOC_iput_data is completed. 00103 * 00104 * @param request \b in request-handle 00105 * @param flag \b out true if operation is completed 00106 * @return 0 when success otherwise error-code 00107 **/ 00108 int IMOC_test_dma(imoc_dma_request* request, int *flag); 00109 00110 00111 00112 00113 //@} 00114 //@} 00115 #endif /*MOC_INTERNAL_GET_DATA_H_*/
1.5.6