Changeset 635 for trunk/kernel/syscalls/sys_exec.c
- Timestamp:
- Jun 26, 2019, 11:42:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/syscalls/sys_exec.c
r626 r635 63 63 uint32_t length; // string length 64 64 kmem_req_t req; // kmem request 65 page_t * page; // page descriptor66 xptr_t base_xp; // extended pointer on page base67 65 uint32_t order; // ln2( number of pages to store strings ) 68 66 char ** k_pointers; // base of kernel array of pointers 67 char * k_buf_base; // base address of the kernel strings buffer 69 68 char * k_buf_ptr; // pointer on first empty slot in kernel strings buffer 70 char * k_buf_base; // base address of the kernel strings buffer71 69 72 70 // compute ln2( number of pages for kernel strings buffer ) … … 74 72 else order = bits_log2( CONFIG_VMM_ENVS_SIZE ); 75 73 76 req.type = KMEM_PAGE; 74 // allocate one physical page for kernel array of pointers 75 req.type = KMEM_PPM; 76 req.order = 0; 77 77 req.flags = AF_KERNEL | AF_ZERO; 78 79 // allocate one physical page for kernel array of pointers 80 req.type = 0; 81 page = kmem_alloc( &req ); 82 83 if( page == NULL ) return ENOMEM; 84 85 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 86 k_pointers = (char **)GET_PTR( base_xp ); 78 k_pointers = kmem_alloc( &req ); 79 80 if( k_pointers == NULL ) return ENOMEM; 87 81 88 82 // allocate several physical pages to store the strings themselve 89 req.type = order; 90 page = kmem_alloc( &req ); 91 92 if( page == NULL ) return ENOMEM; 93 94 base_xp = ppm_page2base( XPTR( local_cxy , page ) ); 95 k_buf_base = (char *)GET_PTR( base_xp ); 83 req.type = KMEM_PPM; 84 req.order = order; 85 req.flags = AF_KERNEL | AF_ZERO; 86 k_buf_base = kmem_alloc( &req ); 87 88 if( k_buf_base == NULL ) return ENOMEM; 96 89 97 90 // copy the array of pointers to kernel buffer
Note: See TracChangeset
for help on using the changeset viewer.