diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-09 18:13:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-09 18:13:33 -0500 |
commit | 59db5b2b9e0327e545ff5764dadcb26062c2ab1f (patch) | |
tree | 478476fa4b9a4396f9f5982b336971726d547ef0 /drivers/staging/tidspbridge/dynload | |
parent | 26e805544a5dfd22b3def27b4c2363cd81a40467 (diff) | |
parent | fbbb4959eee4762a2fa60c6352be2284ebb1cb67 (diff) |
Staging: Merge branch 'tidspbridge-for-2.6.39' of git://dev.omapzoom.org/pub/scm/tidspbridge/kernel-dspbridge into staging-next
* 'tidspbridge-for-2.6.39' of git://dev.omapzoom.org/pub/scm/tidspbridge/kernel-dspbridge: (37 commits)
staging: tidspbridge: set12 remove hungarian from structs
staging: tidspbridge: set11 remove hungarian from structs
staging: tidspbridge: set10 remove hungarian from structs
staging: tidspbridge: set9 remove hungarian from structs
staging: tidspbridge: set8 remove hungarian from structs
staging: tidspbridge: set7 remove hungarian from structs
staging: tidspbridge: set6 remove hungarian from structs
staging: tidspbridge: set5 remove hungarian from structs
staging: tidspbridge: set4 remove hungarian from structs
staging: tidspbridge: set3 remove hungarian from structs
staging: tidspbridge: set2 remove hungarian from structs
staging: tidspbridge: set1 remove hungarian from structs
staging: tidspbridge: remove code referred by OPT_ZERO_COPY_LOADER
staging: tidspbridge: Remove trivial header files
staging: tidspbridge: Remove unused typedefs
staging: tidspbridge: Remove unused structs
staging: tidspbridge: Remove unused functions
staging: tidspbridge: Remove unused defined constants
staging: tidspbridge: Fix atoi to support hexadecimal numbers correctly
staging: tidspbridge: rmgr/node.c code cleanup
...
Diffstat (limited to 'drivers/staging/tidspbridge/dynload')
-rw-r--r-- | drivers/staging/tidspbridge/dynload/cload.c | 102 | ||||
-rw-r--r-- | drivers/staging/tidspbridge/dynload/dload_internal.h | 6 |
2 files changed, 44 insertions, 64 deletions
diff --git a/drivers/staging/tidspbridge/dynload/cload.c b/drivers/staging/tidspbridge/dynload/cload.c index c85a5e88361..390040984e0 100644 --- a/drivers/staging/tidspbridge/dynload/cload.c +++ b/drivers/staging/tidspbridge/dynload/cload.c | |||
@@ -498,8 +498,8 @@ static void allocate_sections(struct dload_state *dlthis) | |||
498 | return; | 498 | return; |
499 | } | 499 | } |
500 | /* initialize the handle header */ | 500 | /* initialize the handle header */ |
501 | hndl->dm.hnext = hndl->dm.hprev = hndl; /* circular list */ | 501 | hndl->dm.next = hndl->dm.prev = hndl; /* circular list */ |
502 | hndl->dm.hroot = NULL; | 502 | hndl->dm.root = NULL; |
503 | hndl->dm.dbthis = 0; | 503 | hndl->dm.dbthis = 0; |
504 | dlthis->myhandle = hndl; /* save away for return */ | 504 | dlthis->myhandle = hndl; /* save away for return */ |
505 | /* pointer to the section list of allocated sections */ | 505 | /* pointer to the section list of allocated sections */ |
@@ -1131,9 +1131,6 @@ static void dload_data(struct dload_state *dlthis) | |||
1131 | u16 curr_sect; | 1131 | u16 curr_sect; |
1132 | struct doff_scnhdr_t *sptr = dlthis->sect_hdrs; | 1132 | struct doff_scnhdr_t *sptr = dlthis->sect_hdrs; |
1133 | struct ldr_section_info *lptr = dlthis->ldr_sections; | 1133 | struct ldr_section_info *lptr = dlthis->ldr_sections; |
1134 | #ifdef OPT_ZERO_COPY_LOADER | ||
1135 | bool zero_copy = false; | ||
1136 | #endif | ||
1137 | u8 *dest; | 1134 | u8 *dest; |
1138 | 1135 | ||
1139 | struct { | 1136 | struct { |
@@ -1192,17 +1189,6 @@ static void dload_data(struct dload_state *dlthis) | |||
1192 | return; | 1189 | return; |
1193 | } | 1190 | } |
1194 | dest = ibuf.bufr; | 1191 | dest = ibuf.bufr; |
1195 | #ifdef OPT_ZERO_COPY_LOADER | ||
1196 | zero_copy = false; | ||
1197 | if (!dload_check_type(sptr, DLOAD_CINIT) { | ||
1198 | dlthis->myio->writemem(dlthis->myio, | ||
1199 | &dest, | ||
1200 | lptr->load_addr + | ||
1201 | image_offset, | ||
1202 | lptr, 0); | ||
1203 | zero_copy = (dest != ibuf.bufr); | ||
1204 | } | ||
1205 | #endif | ||
1206 | /* End of determination */ | 1192 | /* End of determination */ |
1207 | 1193 | ||
1208 | if (dlthis->strm->read_buffer(dlthis->strm, | 1194 | if (dlthis->strm->read_buffer(dlthis->strm, |
@@ -1266,33 +1252,27 @@ static void dload_data(struct dload_state *dlthis) | |||
1266 | &ibuf.ipacket); | 1252 | &ibuf.ipacket); |
1267 | cinit_processed = true; | 1253 | cinit_processed = true; |
1268 | } else { | 1254 | } else { |
1269 | #ifdef OPT_ZERO_COPY_LOADER | 1255 | /* FIXME */ |
1270 | if (!zero_copy) { | 1256 | if (!dlthis->myio-> |
1271 | #endif | 1257 | writemem(dlthis-> |
1272 | /* FIXME */ | 1258 | myio, |
1273 | if (!dlthis->myio-> | 1259 | ibuf.bufr, |
1274 | writemem(dlthis-> | 1260 | lptr-> |
1275 | myio, | 1261 | load_addr + |
1276 | ibuf.bufr, | 1262 | image_offset, |
1277 | lptr-> | 1263 | lptr, |
1278 | load_addr + | 1264 | BYTE_TO_HOST |
1279 | image_offset, | 1265 | (ibuf. |
1280 | lptr, | 1266 | ipacket. |
1281 | BYTE_TO_HOST | 1267 | packet_size))) { |
1282 | (ibuf. | 1268 | DL_ERROR |
1283 | ipacket. | 1269 | ("Write to " |
1284 | packet_size))) { | 1270 | FMT_UI32 |
1285 | DL_ERROR | 1271 | " failed", |
1286 | ("Write to " | 1272 | lptr-> |
1287 | FMT_UI32 | 1273 | load_addr + |
1288 | " failed", | 1274 | image_offset); |
1289 | lptr-> | ||
1290 | load_addr + | ||
1291 | image_offset); | ||
1292 | } | ||
1293 | #ifdef OPT_ZERO_COPY_LOADER | ||
1294 | } | 1275 | } |
1295 | #endif | ||
1296 | } | 1276 | } |
1297 | } | 1277 | } |
1298 | image_offset += | 1278 | image_offset += |
@@ -1646,7 +1626,7 @@ static void init_module_handle(struct dload_state *dlthis) | |||
1646 | DL_ERROR(err_alloc, sizeof(struct dbg_mirror_root)); | 1626 | DL_ERROR(err_alloc, sizeof(struct dbg_mirror_root)); |
1647 | return; | 1627 | return; |
1648 | } | 1628 | } |
1649 | mlst->hnext = NULL; | 1629 | mlst->next = NULL; |
1650 | mlst->changes = 0; | 1630 | mlst->changes = 0; |
1651 | mlst->refcount = 0; | 1631 | mlst->refcount = 0; |
1652 | mlst->dbthis = TDATA_TO_TADDR(dlmodsym->value); | 1632 | mlst->dbthis = TDATA_TO_TADDR(dlmodsym->value); |
@@ -1671,7 +1651,7 @@ static void init_module_handle(struct dload_state *dlthis) | |||
1671 | #else | 1651 | #else |
1672 | mlist = (struct dbg_mirror_root *)&debug_list_header; | 1652 | mlist = (struct dbg_mirror_root *)&debug_list_header; |
1673 | #endif | 1653 | #endif |
1674 | hndl->dm.hroot = mlist; /* set pointer to root into our handle */ | 1654 | hndl->dm.root = mlist; /* set pointer to root into our handle */ |
1675 | if (!dlthis->allocated_secn_count) | 1655 | if (!dlthis->allocated_secn_count) |
1676 | return; /* no load addresses to be recorded */ | 1656 | return; /* no load addresses to be recorded */ |
1677 | /* reuse temporary symbol storage */ | 1657 | /* reuse temporary symbol storage */ |
@@ -1722,9 +1702,9 @@ static void init_module_handle(struct dload_state *dlthis) | |||
1722 | dllview_info.context = 0; | 1702 | dllview_info.context = 0; |
1723 | hndl->dm.context = 0; | 1703 | hndl->dm.context = 0; |
1724 | /* fill in next pointer and size */ | 1704 | /* fill in next pointer and size */ |
1725 | if (mlist->hnext) { | 1705 | if (mlist->next) { |
1726 | dbmod->next_module = TADDR_TO_TDATA(mlist->hnext->dm.dbthis); | 1706 | dbmod->next_module = TADDR_TO_TDATA(mlist->next->dm.dbthis); |
1727 | dbmod->next_module_size = mlist->hnext->dm.dbsiz; | 1707 | dbmod->next_module_size = mlist->next->dm.dbsiz; |
1728 | } else { | 1708 | } else { |
1729 | dbmod->next_module_size = 0; | 1709 | dbmod->next_module_size = 0; |
1730 | dbmod->next_module = 0; | 1710 | dbmod->next_module = 0; |
@@ -1770,11 +1750,11 @@ static void init_module_handle(struct dload_state *dlthis) | |||
1770 | } | 1750 | } |
1771 | /* Add the module handle to this processor's list | 1751 | /* Add the module handle to this processor's list |
1772 | of handles with debug info */ | 1752 | of handles with debug info */ |
1773 | hndl->dm.hnext = mlist->hnext; | 1753 | hndl->dm.next = mlist->next; |
1774 | if (hndl->dm.hnext) | 1754 | if (hndl->dm.next) |
1775 | hndl->dm.hnext->dm.hprev = hndl; | 1755 | hndl->dm.next->dm.prev = hndl; |
1776 | hndl->dm.hprev = (struct my_handle *)mlist; | 1756 | hndl->dm.prev = (struct my_handle *)mlist; |
1777 | mlist->hnext = hndl; /* insert after root */ | 1757 | mlist->next = hndl; /* insert after root */ |
1778 | } /* init_module_handle */ | 1758 | } /* init_module_handle */ |
1779 | 1759 | ||
1780 | /************************************************************************* | 1760 | /************************************************************************* |
@@ -1830,7 +1810,7 @@ int dynamic_unload_module(void *mhandle, | |||
1830 | asecs->name = NULL; | 1810 | asecs->name = NULL; |
1831 | alloc->dload_deallocate(alloc, asecs++); | 1811 | alloc->dload_deallocate(alloc, asecs++); |
1832 | } | 1812 | } |
1833 | root = hndl->dm.hroot; | 1813 | root = hndl->dm.root; |
1834 | if (!root) { | 1814 | if (!root) { |
1835 | /* there is a debug list containing this module */ | 1815 | /* there is a debug list containing this module */ |
1836 | goto func_end; | 1816 | goto func_end; |
@@ -1840,20 +1820,20 @@ int dynamic_unload_module(void *mhandle, | |||
1840 | } | 1820 | } |
1841 | /* Retrieve memory context in which .dllview was allocated */ | 1821 | /* Retrieve memory context in which .dllview was allocated */ |
1842 | dllview_info.context = hndl->dm.context; | 1822 | dllview_info.context = hndl->dm.context; |
1843 | if (hndl->dm.hprev == hndl) | 1823 | if (hndl->dm.prev == hndl) |
1844 | goto exitunltgt; | 1824 | goto exitunltgt; |
1845 | 1825 | ||
1846 | /* target-side dllview record is in list */ | 1826 | /* target-side dllview record is in list */ |
1847 | /* dequeue this record from our GPP-side mirror list */ | 1827 | /* dequeue this record from our GPP-side mirror list */ |
1848 | hndl->dm.hprev->dm.hnext = hndl->dm.hnext; | 1828 | hndl->dm.prev->dm.next = hndl->dm.next; |
1849 | if (hndl->dm.hnext) | 1829 | if (hndl->dm.next) |
1850 | hndl->dm.hnext->dm.hprev = hndl->dm.hprev; | 1830 | hndl->dm.next->dm.prev = hndl->dm.prev; |
1851 | /* Update next_module of previous entry in target list | 1831 | /* Update next_module of previous entry in target list |
1852 | * We are using mhdr here as a surrogate for either a | 1832 | * We are using mhdr here as a surrogate for either a |
1853 | struct modules_header or a dll_module */ | 1833 | struct modules_header or a dll_module */ |
1854 | if (hndl->dm.hnext) { | 1834 | if (hndl->dm.next) { |
1855 | mhdr.first_module = TADDR_TO_TDATA(hndl->dm.hnext->dm.dbthis); | 1835 | mhdr.first_module = TADDR_TO_TDATA(hndl->dm.next->dm.dbthis); |
1856 | mhdr.first_module_size = hndl->dm.hnext->dm.dbsiz; | 1836 | mhdr.first_module_size = hndl->dm.next->dm.dbsiz; |
1857 | } else { | 1837 | } else { |
1858 | mhdr.first_module = 0; | 1838 | mhdr.first_module = 0; |
1859 | mhdr.first_module_size = 0; | 1839 | mhdr.first_module_size = 0; |
@@ -1871,7 +1851,7 @@ int dynamic_unload_module(void *mhandle, | |||
1871 | swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16), | 1851 | swap_words(&mhdr, sizeof(struct modules_header) - sizeof(u16), |
1872 | MODULES_HEADER_BITMAP); | 1852 | MODULES_HEADER_BITMAP); |
1873 | } | 1853 | } |
1874 | if (!init->writemem(init, &mhdr, hndl->dm.hprev->dm.dbthis, | 1854 | if (!init->writemem(init, &mhdr, hndl->dm.prev->dm.dbthis, |
1875 | &dllview_info, sizeof(struct modules_header) - | 1855 | &dllview_info, sizeof(struct modules_header) - |
1876 | sizeof(mhdr.update_flag))) { | 1856 | sizeof(mhdr.update_flag))) { |
1877 | dload_syms_error(syms, dlvwrite); | 1857 | dload_syms_error(syms, dlvwrite); |
diff --git a/drivers/staging/tidspbridge/dynload/dload_internal.h b/drivers/staging/tidspbridge/dynload/dload_internal.h index 302a7c53e12..7b77573fba5 100644 --- a/drivers/staging/tidspbridge/dynload/dload_internal.h +++ b/drivers/staging/tidspbridge/dynload/dload_internal.h | |||
@@ -78,15 +78,15 @@ struct my_handle; | |||
78 | struct dbg_mirror_root { | 78 | struct dbg_mirror_root { |
79 | /* must be same as dbg_mirror_list; __DLModules address on target */ | 79 | /* must be same as dbg_mirror_list; __DLModules address on target */ |
80 | u32 dbthis; | 80 | u32 dbthis; |
81 | struct my_handle *hnext; /* must be same as dbg_mirror_list */ | 81 | struct my_handle *next; /* must be same as dbg_mirror_list */ |
82 | u16 changes; /* change counter */ | 82 | u16 changes; /* change counter */ |
83 | u16 refcount; /* number of modules referencing this root */ | 83 | u16 refcount; /* number of modules referencing this root */ |
84 | }; | 84 | }; |
85 | 85 | ||
86 | struct dbg_mirror_list { | 86 | struct dbg_mirror_list { |
87 | u32 dbthis; | 87 | u32 dbthis; |
88 | struct my_handle *hnext, *hprev; | 88 | struct my_handle *next, *prev; |
89 | struct dbg_mirror_root *hroot; | 89 | struct dbg_mirror_root *root; |
90 | u16 dbsiz; | 90 | u16 dbsiz; |
91 | u32 context; /* Save context for .dllview memory allocation */ | 91 | u32 context; /* Save context for .dllview memory allocation */ |
92 | }; | 92 | }; |