Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset d7dfa05 in mainline


Ignore:
Timestamp:
2019-06-20T14:07:25Z (17 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
5acf533
Parents:
64b7854
Message:

Make the types ccheck-safe

Instead of using uspace_ptr(char), use uspace_ptr_char which is
defined as #define uspace_ptr_char uspace_ptr(char).

Files:
26 edited

Legend:

Unmodified
Added
Removed
  • abi/include/_bits/native.h

    r64b7854 rd7dfa05  
    7070#endif
    7171
     72#define uspace_ptr_as_area_info_t uspace_ptr(as_area_info_t)
     73#define uspace_ptr_as_area_pager_info_t uspace_ptr(as_area_pager_info_t)
     74#define uspace_ptr_cap_irq_handle_t uspace_ptr(cap_irq_handle_t)
     75#define uspace_ptr_cap_phone_handle_t uspace_ptr(cap_phone_handle_t)
     76#define uspace_ptr_cap_waitq_handle_t uspace_ptr(cap_waitq_handle_t)
     77#define uspace_ptr_char uspace_ptr(char)
     78#define uspace_ptr_const_char uspace_ptr(const char)
     79#define uspace_ptr_ddi_ioarg_t uspace_ptr(ddi_ioarg_t)
     80#define uspace_ptr_ipc_data_t uspace_ptr(ipc_data_t)
     81#define uspace_ptr_irq_code_t uspace_ptr(irq_code_t)
     82#define uspace_ptr_size_t uspace_ptr(size_t)
     83#define uspace_ptr_struct_uspace_arg uspace_ptr(struct uspace_arg)
     84#define uspace_ptr_sysarg64_t uspace_ptr(sysarg64_t)
     85#define uspace_ptr_task_id_t uspace_ptr(task_id_t)
     86#define uspace_ptr_thread_id_t uspace_ptr(thread_id_t)
     87#define uspace_ptr_uintptr_t uspace_ptr(uintptr_t)
     88#define uspace_ptr_uspace_arg_t uspace_ptr(uspace_arg_t)
     89#define uspace_ptr_uspace_thread_function_t uspace_ptr(uspace_thread_function_t)
     90
    7291__HELENOS_DECLS_END;
    7392
  • abi/include/abi/proc/uarg.h

    r64b7854 rd7dfa05  
    4747        size_t uspace_stack_size;
    4848
    49         uspace_ptr(uspace_thread_function_t) uspace_thread_function;
     49        uspace_ptr_uspace_thread_function_t uspace_thread_function;
    5050        uspace_addr_t uspace_thread_arg;
    5151
    52         uspace_ptr(struct uspace_arg) uspace_uarg;
     52        uspace_ptr_struct_uspace_arg uspace_uarg;
    5353} uspace_arg_t;
    5454
  • kernel/generic/include/ddi/ddi.h

    r64b7854 rd7dfa05  
    7171extern sys_errno_t sys_dmamem_unmap(uintptr_t, size_t, unsigned int);
    7272
    73 extern sys_errno_t sys_iospace_enable(uspace_ptr(ddi_ioarg_t));
    74 extern sys_errno_t sys_iospace_disable(uspace_ptr(ddi_ioarg_t));
     73extern sys_errno_t sys_iospace_enable(uspace_ptr_ddi_ioarg_t);
     74extern sys_errno_t sys_iospace_disable(uspace_ptr_ddi_ioarg_t);
    7575
    7676/*
  • kernel/generic/include/ipc/irq.h

    r64b7854 rd7dfa05  
    5050extern void ipc_irq_top_half_handler(irq_t *);
    5151
    52 extern errno_t ipc_irq_subscribe(answerbox_t *, inr_t, sysarg_t, uspace_ptr(irq_code_t),
    53     uspace_ptr(cap_irq_handle_t));
     52extern errno_t ipc_irq_subscribe(answerbox_t *, inr_t, sysarg_t, uspace_ptr_irq_code_t,
     53    uspace_ptr_cap_irq_handle_t);
    5454extern errno_t ipc_irq_unsubscribe(answerbox_t *, cap_irq_handle_t);
    5555
  • kernel/generic/include/ipc/sysipc.h

    r64b7854 rd7dfa05  
    4444extern sys_errno_t sys_ipc_call_async_fast(cap_phone_handle_t, sysarg_t,
    4545    sysarg_t, sysarg_t, sysarg_t, sysarg_t);
    46 extern sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t, uspace_ptr(ipc_data_t),
     46extern sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t, uspace_ptr_ipc_data_t,
    4747    sysarg_t);
    4848extern sys_errno_t sys_ipc_answer_fast(cap_call_handle_t, sysarg_t, sysarg_t,
    4949    sysarg_t, sysarg_t, sysarg_t);
    50 extern sys_errno_t sys_ipc_answer_slow(cap_call_handle_t, uspace_ptr(ipc_data_t));
    51 extern sys_errno_t sys_ipc_wait_for_call(uspace_ptr(ipc_data_t), uint32_t, unsigned int);
     50extern sys_errno_t sys_ipc_answer_slow(cap_call_handle_t, uspace_ptr_ipc_data_t);
     51extern sys_errno_t sys_ipc_wait_for_call(uspace_ptr_ipc_data_t, uint32_t, unsigned int);
    5252extern sys_errno_t sys_ipc_poke(void);
    5353extern sys_errno_t sys_ipc_forward_fast(cap_call_handle_t, cap_phone_handle_t,
    5454    sysarg_t, sysarg_t, sysarg_t, unsigned int);
    5555extern sys_errno_t sys_ipc_forward_slow(cap_call_handle_t, cap_phone_handle_t,
    56     uspace_ptr(ipc_data_t), unsigned int);
     56    uspace_ptr_ipc_data_t, unsigned int);
    5757extern sys_errno_t sys_ipc_hangup(cap_phone_handle_t);
    5858
    59 extern sys_errno_t sys_ipc_irq_subscribe(inr_t, sysarg_t, uspace_ptr(irq_code_t),
    60     uspace_ptr(cap_irq_handle_t));
     59extern sys_errno_t sys_ipc_irq_subscribe(inr_t, sysarg_t, uspace_ptr_irq_code_t,
     60    uspace_ptr_cap_irq_handle_t);
    6161extern sys_errno_t sys_ipc_irq_unsubscribe(cap_irq_handle_t);
    6262
    63 extern sys_errno_t sys_ipc_connect_kbox(uspace_ptr(task_id_t), uspace_ptr(cap_phone_handle_t));
     63extern sys_errno_t sys_ipc_connect_kbox(uspace_ptr_task_id_t, uspace_ptr_cap_phone_handle_t);
    6464
    6565#endif
  • kernel/generic/include/log.h

    r64b7854 rd7dfa05  
    5353
    5454extern sys_errno_t sys_klog(sysarg_t, uspace_addr_t buf, size_t size,
    55     sysarg_t level, uspace_ptr(size_t) uspace_nread);
     55    sysarg_t level, uspace_ptr_size_t uspace_nread);
    5656
    5757#endif /* KERN_LOG_H_ */
  • kernel/generic/include/mm/as.h

    r64b7854 rd7dfa05  
    373373/* Address space area related syscalls. */
    374374extern sysarg_t sys_as_area_create(uintptr_t, size_t, unsigned int, uintptr_t,
    375     uspace_ptr(as_area_pager_info_t));
     375    uspace_ptr_as_area_pager_info_t);
    376376extern sys_errno_t sys_as_area_resize(uintptr_t, size_t, unsigned int);
    377377extern sys_errno_t sys_as_area_change_flags(uintptr_t, unsigned int);
    378 extern sys_errno_t sys_as_area_get_info(uintptr_t, uspace_ptr(as_area_info_t));
     378extern sys_errno_t sys_as_area_get_info(uintptr_t, uspace_ptr_as_area_info_t);
    379379extern sys_errno_t sys_as_area_destroy(uintptr_t);
    380380
  • kernel/generic/include/mm/page.h

    r64b7854 rd7dfa05  
    6868
    6969extern errno_t page_find_mapping(uintptr_t, uintptr_t *);
    70 extern sys_errno_t sys_page_find_mapping(uintptr_t, uspace_ptr(uintptr_t));
     70extern sys_errno_t sys_page_find_mapping(uintptr_t, uspace_ptr_uintptr_t);
    7171
    7272#endif
  • kernel/generic/include/proc/program.h

    r64b7854 rd7dfa05  
    6060extern void program_ready(program_t *);
    6161
    62 extern sys_errno_t sys_program_spawn_loader(uspace_ptr(char), size_t);
     62extern sys_errno_t sys_program_spawn_loader(uspace_ptr_char, size_t);
    6363
    6464#endif
  • kernel/generic/include/proc/task.h

    r64b7854 rd7dfa05  
    164164
    165165#ifdef __32_BITS__
    166 extern sys_errno_t sys_task_get_id(uspace_ptr(sysarg64_t));
     166extern sys_errno_t sys_task_get_id(uspace_ptr_sysarg64_t);
    167167#endif
    168168
     
    171171#endif
    172172
    173 extern sys_errno_t sys_task_set_name(uspace_ptr(const char), size_t);
    174 extern sys_errno_t sys_task_kill(uspace_ptr(task_id_t));
     173extern sys_errno_t sys_task_set_name(uspace_ptr_const_char, size_t);
     174extern sys_errno_t sys_task_kill(uspace_ptr_task_id_t);
    175175extern sys_errno_t sys_task_exit(sysarg_t);
    176176
  • kernel/generic/include/proc/thread.h

    r64b7854 rd7dfa05  
    265265
    266266/* Thread syscall prototypes. */
    267 extern sys_errno_t sys_thread_create(uspace_ptr(uspace_arg_t), uspace_ptr(char), size_t,
    268     uspace_ptr(thread_id_t));
     267extern sys_errno_t sys_thread_create(uspace_ptr_uspace_arg_t, uspace_ptr_char, size_t,
     268    uspace_ptr_thread_id_t);
    269269extern sys_errno_t sys_thread_exit(int);
    270 extern sys_errno_t sys_thread_get_id(uspace_ptr(thread_id_t));
     270extern sys_errno_t sys_thread_get_id(uspace_ptr_thread_id_t);
    271271extern sys_errno_t sys_thread_usleep(uint32_t);
    272272extern sys_errno_t sys_thread_udelay(uint32_t);
  • kernel/generic/include/security/perm.h

    r64b7854 rd7dfa05  
    7575#ifdef __32_BITS__
    7676
    77 extern sys_errno_t sys_perm_grant(uspace_ptr(sysarg64_t), perm_t);
    78 extern sys_errno_t sys_perm_revoke(uspace_ptr(sysarg64_t), perm_t);
     77extern sys_errno_t sys_perm_grant(uspace_ptr_sysarg64_t, perm_t);
     78extern sys_errno_t sys_perm_revoke(uspace_ptr_sysarg64_t, perm_t);
    7979
    8080#endif  /* __32_BITS__ */
  • kernel/generic/include/synch/syswaitq.h

    r64b7854 rd7dfa05  
    4343extern void sys_waitq_task_cleanup(void);
    4444
    45 extern sys_errno_t sys_waitq_create(uspace_ptr(cap_waitq_handle_t));
     45extern sys_errno_t sys_waitq_create(uspace_ptr_cap_waitq_handle_t);
    4646extern sys_errno_t sys_waitq_sleep(cap_waitq_handle_t, uint32_t, unsigned int);
    4747extern sys_errno_t sys_waitq_wakeup(cap_waitq_handle_t);
  • kernel/generic/include/sysinfo/sysinfo.h

    r64b7854 rd7dfa05  
    163163
    164164extern sys_errno_t sys_sysinfo_get_keys_size(uspace_addr_t, size_t, uspace_addr_t);
    165 extern sys_errno_t sys_sysinfo_get_keys(uspace_addr_t, size_t, uspace_addr_t, size_t, uspace_ptr(size_t));
     165extern sys_errno_t sys_sysinfo_get_keys(uspace_addr_t, size_t, uspace_addr_t, size_t, uspace_ptr_size_t);
    166166extern sysarg_t sys_sysinfo_get_val_type(uspace_addr_t, size_t);
    167167extern sys_errno_t sys_sysinfo_get_value(uspace_addr_t, size_t, uspace_addr_t);
    168168extern sys_errno_t sys_sysinfo_get_data_size(uspace_addr_t, size_t, uspace_addr_t);
    169 extern sys_errno_t sys_sysinfo_get_data(uspace_addr_t, size_t, uspace_addr_t, size_t, uspace_ptr(size_t));
     169extern sys_errno_t sys_sysinfo_get_data(uspace_addr_t, size_t, uspace_addr_t, size_t, uspace_ptr_size_t);
    170170
    171171#endif
  • kernel/generic/src/ddi/ddi.c

    r64b7854 rd7dfa05  
    393393 *
    394394 */
    395 sys_errno_t sys_iospace_enable(uspace_ptr(ddi_ioarg_t) uspace_io_arg)
     395sys_errno_t sys_iospace_enable(uspace_ptr_ddi_ioarg_t uspace_io_arg)
    396396{
    397397        ddi_ioarg_t arg;
     
    404404}
    405405
    406 sys_errno_t sys_iospace_disable(uspace_ptr(ddi_ioarg_t) uspace_io_arg)
     406sys_errno_t sys_iospace_disable(uspace_ptr_ddi_ioarg_t uspace_io_arg)
    407407{
    408408        ddi_ioarg_t arg;
  • kernel/generic/src/ipc/irq.c

    r64b7854 rd7dfa05  
    223223 *
    224224 */
    225 static irq_code_t *code_from_uspace(uspace_ptr(irq_code_t) ucode)
     225static irq_code_t *code_from_uspace(uspace_ptr_irq_code_t ucode)
    226226{
    227227        irq_pio_range_t *ranges = NULL;
     
    323323 */
    324324errno_t ipc_irq_subscribe(answerbox_t *box, inr_t inr, sysarg_t imethod,
    325     uspace_ptr(irq_code_t) ucode, uspace_ptr(cap_irq_handle_t) uspace_handle)
     325    uspace_ptr_irq_code_t ucode, uspace_ptr_cap_irq_handle_t uspace_handle)
    326326{
    327327        if ((inr < 0) || (inr > last_inr))
  • kernel/generic/src/ipc/sysipc.c

    r64b7854 rd7dfa05  
    419419 *
    420420 */
    421 sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t handle, uspace_ptr(ipc_data_t) data,
     421sys_errno_t sys_ipc_call_async_slow(cap_phone_handle_t handle, uspace_ptr_ipc_data_t data,
    422422    sysarg_t label)
    423423{
     
    623623 */
    624624sys_errno_t sys_ipc_forward_slow(cap_call_handle_t chandle,
    625     cap_phone_handle_t phandle, uspace_ptr(ipc_data_t) data, unsigned int mode)
     625    cap_phone_handle_t phandle, uspace_ptr_ipc_data_t data, unsigned int mode)
    626626{
    627627        ipc_data_t newdata;
     
    700700 *
    701701 */
    702 sys_errno_t sys_ipc_answer_slow(cap_call_handle_t chandle, uspace_ptr(ipc_data_t) data)
     702sys_errno_t sys_ipc_answer_slow(cap_call_handle_t chandle, uspace_ptr_ipc_data_t data)
    703703{
    704704        kobject_t *kobj = cap_unpublish(TASK, chandle, KOBJECT_TYPE_CALL);
     
    766766 * @return An error code on error.
    767767 */
    768 sys_errno_t sys_ipc_wait_for_call(uspace_ptr(ipc_data_t) calldata, uint32_t usec,
     768sys_errno_t sys_ipc_wait_for_call(uspace_ptr_ipc_data_t calldata, uint32_t usec,
    769769    unsigned int flags)
    770770{
     
    888888 */
    889889sys_errno_t sys_ipc_irq_subscribe(inr_t inr, sysarg_t imethod,
    890     uspace_ptr(irq_code_t) ucode, uspace_ptr(cap_irq_handle_t) uspace_handle)
     890    uspace_ptr_irq_code_t ucode, uspace_ptr_cap_irq_handle_t uspace_handle)
    891891{
    892892        if (!(perm_get(TASK) & PERM_IRQ_REG))
     
    918918 *
    919919 */
    920 sys_errno_t sys_ipc_connect_kbox(uspace_ptr(task_id_t) uspace_taskid,
    921     uspace_ptr(cap_phone_handle_t) uspace_phone)
     920sys_errno_t sys_ipc_connect_kbox(uspace_ptr_task_id_t uspace_taskid,
     921    uspace_ptr_cap_phone_handle_t uspace_phone)
    922922{
    923923#ifdef CONFIG_UDEBUG
  • kernel/generic/src/log/log.c

    r64b7854 rd7dfa05  
    296296 */
    297297sys_errno_t sys_klog(sysarg_t operation, uspace_addr_t buf, size_t size,
    298     sysarg_t level, uspace_ptr(size_t) uspace_nread)
     298    sysarg_t level, uspace_ptr_size_t uspace_nread)
    299299{
    300300        char *data;
  • kernel/generic/src/mm/as.c

    r64b7854 rd7dfa05  
    20922092
    20932093sysarg_t sys_as_area_create(uintptr_t base, size_t size, unsigned int flags,
    2094     uintptr_t bound, uspace_ptr(as_area_pager_info_t) pager_info)
     2094    uintptr_t bound, uspace_ptr_as_area_pager_info_t pager_info)
    20952095{
    20962096        uintptr_t virt = base;
     
    21252125}
    21262126
    2127 sys_errno_t sys_as_area_get_info(uintptr_t address, uspace_ptr(as_area_info_t) dest)
     2127sys_errno_t sys_as_area_get_info(uintptr_t address, uspace_ptr_as_area_info_t dest)
    21282128{
    21292129        as_area_t *area;
  • kernel/generic/src/mm/page.c

    r64b7854 rd7dfa05  
    215215 *
    216216 */
    217 sys_errno_t sys_page_find_mapping(uintptr_t virt, uspace_ptr(uintptr_t) phys_ptr)
     217sys_errno_t sys_page_find_mapping(uintptr_t virt, uspace_ptr_uintptr_t phys_ptr)
    218218{
    219219        uintptr_t phys;
  • kernel/generic/src/proc/program.c

    r64b7854 rd7dfa05  
    218218 *
    219219 */
    220 sys_errno_t sys_program_spawn_loader(uspace_ptr(char) uspace_name, size_t name_len)
     220sys_errno_t sys_program_spawn_loader(uspace_ptr_char uspace_name, size_t name_len)
    221221{
    222222        /* Cap length of name and copy it from userspace. */
  • kernel/generic/src/proc/task.c

    r64b7854 rd7dfa05  
    323323 *
    324324 */
    325 sys_errno_t sys_task_get_id(uspace_ptr(sysarg64_t) uspace_taskid)
     325sys_errno_t sys_task_get_id(uspace_ptr_sysarg64_t uspace_taskid)
    326326{
    327327        /*
     
    363363 *
    364364 */
    365 sys_errno_t sys_task_set_name(const uspace_ptr(char) uspace_name, size_t name_len)
     365sys_errno_t sys_task_set_name(const uspace_ptr_char uspace_name, size_t name_len)
    366366{
    367367        char namebuf[TASK_NAME_BUFLEN];
     
    404404 *
    405405 */
    406 sys_errno_t sys_task_kill(uspace_ptr(task_id_t) uspace_taskid)
     406sys_errno_t sys_task_kill(uspace_ptr_task_id_t uspace_taskid)
    407407{
    408408        task_id_t taskid;
  • kernel/generic/src/proc/thread.c

    r64b7854 rd7dfa05  
    998998 *
    999999 */
    1000 sys_errno_t sys_thread_create(uspace_ptr(uspace_arg_t) uspace_uarg, uspace_ptr(char) uspace_name,
    1001     size_t name_len, uspace_ptr(thread_id_t) uspace_thread_id)
     1000sys_errno_t sys_thread_create(uspace_ptr_uspace_arg_t uspace_uarg, uspace_ptr_char uspace_name,
     1001    size_t name_len, uspace_ptr_thread_id_t uspace_thread_id)
    10021002{
    10031003        if (name_len > THREAD_NAME_BUFLEN - 1)
     
    10881088 *
    10891089 */
    1090 sys_errno_t sys_thread_get_id(uspace_ptr(thread_id_t) uspace_thread_id)
     1090sys_errno_t sys_thread_get_id(uspace_ptr_thread_id_t uspace_thread_id)
    10911091{
    10921092        /*
  • kernel/generic/src/security/perm.c

    r64b7854 rd7dfa05  
    158158 *
    159159 */
    160 sys_errno_t sys_perm_grant(uspace_ptr(sysarg64_t) uspace_taskid, perm_t perms)
     160sys_errno_t sys_perm_grant(uspace_ptr_sysarg64_t uspace_taskid, perm_t perms)
    161161{
    162162        sysarg64_t taskid;
     
    179179 *
    180180 */
    181 sys_errno_t sys_perm_revoke(uspace_ptr(sysarg64_t) uspace_taskid, perm_t perms)
     181sys_errno_t sys_perm_revoke(uspace_ptr_sysarg64_t uspace_taskid, perm_t perms)
    182182{
    183183        sysarg64_t taskid;
  • kernel/generic/src/synch/syswaitq.c

    r64b7854 rd7dfa05  
    8888 * @return              Error code.
    8989 */
    90 sys_errno_t sys_waitq_create(uspace_ptr(cap_waitq_handle_t) whandle)
     90sys_errno_t sys_waitq_create(uspace_ptr_cap_waitq_handle_t whandle)
    9191{
    9292        waitq_t *wq = slab_alloc(waitq_cache, FRAME_ATOMIC);
  • kernel/generic/src/sysinfo/sysinfo.c

    r64b7854 rd7dfa05  
    880880 */
    881881sys_errno_t sys_sysinfo_get_keys(uspace_addr_t path_ptr, size_t path_size,
    882     uspace_addr_t buffer_ptr, size_t buffer_size, uspace_ptr(size_t) size_ptr)
     882    uspace_addr_t buffer_ptr, size_t buffer_size, uspace_ptr_size_t size_ptr)
    883883{
    884884        errno_t rc;
     
    10371037 */
    10381038sys_errno_t sys_sysinfo_get_data(uspace_addr_t path_ptr, size_t path_size,
    1039     uspace_addr_t buffer_ptr, size_t buffer_size, uspace_ptr(size_t) size_ptr)
     1039    uspace_addr_t buffer_ptr, size_t buffer_size, uspace_ptr_size_t size_ptr)
    10401040{
    10411041        errno_t rc;
Note: See TracChangeset for help on using the changeset viewer.