Ignore:
Timestamp:
Jul 31, 2017, 2:28:19 PM (7 years ago)
Author:
max@…
Message:

Passably handle everything in the function itself.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/tsar_mips32/core/hal_uspace.c

    r299 r300  
    139139    uint32_t src = (uint32_t)u_src;
    140140    uint32_t dst = (uint32_t)k_dst;
     141    uint32_t length;
     142    error_t error;
     143    paddr_t paddr;
     144
     145    // XXX XXX XXX: must be converted, to handle faults
     146    error = vmm_v2p_translate( false , u_src , &paddr );
     147    if( error )
     148    {
     149        return EFAULT;
     150    }
     151    length = hal_strlen_from_uspace( u_src );
     152    if( length >= max_size )
     153    {
     154        return EFAULT;
     155    }
    141156
    142157    hal_disable_irq( &save_sr );
Note: See TracChangeset for help on using the changeset viewer.