pussuw commented on code in PR #16344:
URL: https://github.com/apache/nuttx/pull/16344#discussion_r2081060645
##########
arch/arm/src/armv7-a/arm_addrenv_shm.c:
##########
@@ -69,36 +69,28 @@
int up_shmat(uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
{
struct tcb_s *tcb = this_task();
- struct arch_addrenv_s *addrenv;
- uintptr_t *l1entry;
- uint32_t *l2table;
- irqstate_t flags;
+ uintptr_t l1entry;
+ uintptr_t *l2table;
uintptr_t paddr;
unsigned int nmapped;
- unsigned int shmndx;
/* Sanity checks */
DEBUGASSERT(pages && npages > 0 && tcb && tcb->addrenv_own);
DEBUGASSERT(vaddr >= CONFIG_ARCH_SHM_VBASE && vaddr < ARCH_SHM_VEND);
DEBUGASSERT(MM_ISALIGNED(vaddr));
- addrenv = &tcb->addrenv_own->addrenv;
-
/* Loop until all pages have been mapped into the caller's address space. */
for (nmapped = 0; nmapped < npages; )
{
- /* Get the shm[] index associated with the virtual address */
-
- shmndx = (vaddr - CONFIG_ARCH_SHM_VBASE) >> SECTION_SHIFT;
-
/* Has a level 1 page table entry been created for this virtual
* address.
*/
- l1entry = addrenv->shm[shmndx];
- if (l1entry == NULL)
+ l1entry = mmu_l1_getentry(vaddr);
Review Comment:
This now assumes the correct mappings are currently installed, while the old
implementation did not. Is this a problem ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]