long mfc_mem_ext_ofs(unsigned long addr, unsigned int size, int from) { int port; long ofs; if (from >= mem_ports) from = mem_ports - 1; port = mfc_mem_addr_port(addr); if (port < 0) { mfc_dbg("given address is out of MFC: " "0x%08lx\n", addr); port = from; } else if (port != from) { mfc_warn("given address is in the port#%d [%d]", port, from); port = from; } ofs = addr - mem_infos[port].base; if ((ofs < 0) || (ofs >= MAX_MEM_OFFSET)) { mfc_err("given address cannot access by MFC: " "0x%08lx\n", addr); ofs = -MAX_MEM_OFFSET; } else if ((ofs + size) > MAX_MEM_OFFSET) { mfc_warn("some part of given address cannot access: " "0x%08lx\n", addr); } return ofs; }
unsigned long mfc_mem_base_ofs(unsigned long addr) { int port; port = mfc_mem_addr_port(addr); if (port < 0) return 0; return addr - mem_infos[port].base; }
unsigned int mfc_mem_base_ofs(unsigned int addr) { int port; #ifdef CONFIG_EXYNOS4_CONTENT_PATH_PROTECTION port = 0; #else port = mfc_mem_addr_port(addr); #endif if (port < 0) return 0; return addr - mem_infos[port].base; }
unsigned long mfc_mem_data_ofs(unsigned long addr, int contig) { unsigned int offset; int i; int port; port = mfc_mem_addr_port(addr); if (port < 0) return 0; offset = addr - mfc_mem_data_base(port); if (contig) { for (i = 0; i < port; i++) offset += mfc_mem_data_size(i); } return offset; }
unsigned int mfc_mem_data_ofs(unsigned int addr, int contig) { unsigned int offset; int i; int port; #ifdef CONFIG_EXYNOS4_CONTENT_PATH_PROTECTION port = 0; #else port = mfc_mem_addr_port(addr); #endif if (port < 0) return 0; offset = addr - mfc_mem_data_base(port); if (contig) { for (i = 0; i < port; i++) offset += mfc_mem_data_size(i); } return offset; }