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

Changeset 134e3f1 in mainline


Ignore:
Timestamp:
2017-05-30T19:15:50Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
9a99aa5
Parents:
9f9b6f0e
Message:

Use designated initializers for syscall_table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/syscall/syscall.c

    r9f9b6f0e r134e3f1  
    123123syshandler_t syscall_table[SYSCALL_END] = {
    124124        /* System management syscalls. */
    125         (syshandler_t) sys_kio,
     125        [SYS_KIO] = (syshandler_t) sys_kio,
    126126       
    127127        /* Thread and task related syscalls. */
    128         (syshandler_t) sys_thread_create,
    129         (syshandler_t) sys_thread_exit,
    130         (syshandler_t) sys_thread_get_id,
    131         (syshandler_t) sys_thread_usleep,
    132         (syshandler_t) sys_thread_udelay,
    133        
    134         (syshandler_t) sys_task_get_id,
    135         (syshandler_t) sys_task_set_name,
    136         (syshandler_t) sys_task_kill,
    137         (syshandler_t) sys_task_exit,
    138         (syshandler_t) sys_program_spawn_loader,
     128        [SYS_THREAD_CREATE] = (syshandler_t) sys_thread_create,
     129        [SYS_THREAD_EXIT] = (syshandler_t) sys_thread_exit,
     130        [SYS_THREAD_GET_ID] = (syshandler_t) sys_thread_get_id,
     131        [SYS_THREAD_USLEEP] = (syshandler_t) sys_thread_usleep,
     132        [SYS_THREAD_UDELAY] = (syshandler_t) sys_thread_udelay,
     133       
     134        [SYS_TASK_GET_ID] = (syshandler_t) sys_task_get_id,
     135        [SYS_TASK_SET_NAME] = (syshandler_t) sys_task_set_name,
     136        [SYS_TASK_KILL] = (syshandler_t) sys_task_kill,
     137        [SYS_TASK_EXIT] = (syshandler_t) sys_task_exit,
     138        [SYS_PROGRAM_SPAWN_LOADER] = (syshandler_t) sys_program_spawn_loader,
    139139       
    140140        /* Synchronization related syscalls. */
    141         (syshandler_t) sys_futex_sleep,
    142         (syshandler_t) sys_futex_wakeup,
    143         (syshandler_t) sys_smc_coherence,
    144         (syshandler_t) sys_smp_memory_barrier,
    145        
     141        [SYS_FUTEX_SLEEP] = (syshandler_t) sys_futex_sleep,
     142        [SYS_FUTEX_WAKEUP] = (syshandler_t) sys_futex_wakeup,
     143        [SYS_SMC_COHERENCE] = (syshandler_t) sys_smc_coherence,
     144        [SYS_SMP_MEMORY_BARRIER] = (syshandler_t) sys_smp_memory_barrier,
    146145       
    147146        /* Address space related syscalls. */
    148         (syshandler_t) sys_as_area_create,
    149         (syshandler_t) sys_as_area_resize,
    150         (syshandler_t) sys_as_area_change_flags,
    151         (syshandler_t) sys_as_area_destroy,
     147        [SYS_AS_AREA_CREATE] = (syshandler_t) sys_as_area_create,
     148        [SYS_AS_AREA_RESIZE] = (syshandler_t) sys_as_area_resize,
     149        [SYS_AS_AREA_CHANGE_FLAGS] = (syshandler_t) sys_as_area_change_flags,
     150        [SYS_AS_AREA_DESTROY] = (syshandler_t) sys_as_area_destroy,
    152151       
    153152        /* Page mapping related syscalls. */
    154         (syshandler_t) sys_page_find_mapping,
     153        [SYS_PAGE_FIND_MAPPING] = (syshandler_t) sys_page_find_mapping,
    155154       
    156155        /* IPC related syscalls. */
    157         (syshandler_t) sys_ipc_call_async_fast,
    158         (syshandler_t) sys_ipc_call_async_slow,
    159         (syshandler_t) sys_ipc_answer_fast,
    160         (syshandler_t) sys_ipc_answer_slow,
    161         (syshandler_t) sys_ipc_forward_fast,
    162         (syshandler_t) sys_ipc_forward_slow,
    163         (syshandler_t) sys_ipc_wait_for_call,
    164         (syshandler_t) sys_ipc_poke,
    165         (syshandler_t) sys_ipc_hangup,
    166         (syshandler_t) sys_ipc_connect_kbox,
     156        [SYS_IPC_CALL_ASYNC_FAST] = (syshandler_t) sys_ipc_call_async_fast,
     157        [SYS_IPC_CALL_ASYNC_SLOW] = (syshandler_t) sys_ipc_call_async_slow,
     158        [SYS_IPC_ANSWER_FAST] = (syshandler_t) sys_ipc_answer_fast,
     159        [SYS_IPC_ANSWER_SLOW] = (syshandler_t) sys_ipc_answer_slow,
     160        [SYS_IPC_FORWARD_FAST] = (syshandler_t) sys_ipc_forward_fast,
     161        [SYS_IPC_FORWARD_SLOW] = (syshandler_t) sys_ipc_forward_slow,
     162        [SYS_IPC_WAIT] = (syshandler_t) sys_ipc_wait_for_call,
     163        [SYS_IPC_POKE] = (syshandler_t) sys_ipc_poke,
     164        [SYS_IPC_HANGUP] = (syshandler_t) sys_ipc_hangup,
     165        [SYS_IPC_CONNECT_KBOX] = (syshandler_t) sys_ipc_connect_kbox,
    167166       
    168167        /* Event notification syscalls. */
    169         (syshandler_t) sys_ipc_event_subscribe,
    170         (syshandler_t) sys_ipc_event_unsubscribe,
    171         (syshandler_t) sys_ipc_event_unmask,
     168        [SYS_IPC_EVENT_SUBSCRIBE] = (syshandler_t) sys_ipc_event_subscribe,
     169        [SYS_IPC_EVENT_UNSUBSCRIBE] = (syshandler_t) sys_ipc_event_unsubscribe,
     170        [SYS_IPC_EVENT_UNMASK] = (syshandler_t) sys_ipc_event_unmask,
    172171       
    173172        /* Permission related syscalls. */
    174         (syshandler_t) sys_perm_grant,
    175         (syshandler_t) sys_perm_revoke,
     173        [SYS_PERM_GRANT] = (syshandler_t) sys_perm_grant,
     174        [SYS_PERM_REVOKE] = (syshandler_t) sys_perm_revoke,
    176175       
    177176        /* DDI related syscalls. */
    178         (syshandler_t) sys_device_assign_devno,
    179         (syshandler_t) sys_physmem_map,
    180         (syshandler_t) sys_physmem_unmap,
    181         (syshandler_t) sys_dmamem_map,
    182         (syshandler_t) sys_dmamem_unmap,
    183         (syshandler_t) sys_iospace_enable,
    184         (syshandler_t) sys_iospace_disable,
    185        
    186         (syshandler_t) sys_ipc_irq_subscribe,
    187         (syshandler_t) sys_ipc_irq_unsubscribe,
     177        [SYS_DEVICE_ASSIGN_DEVNO] = (syshandler_t) sys_device_assign_devno,
     178        [SYS_PHYSMEM_MAP] = (syshandler_t) sys_physmem_map,
     179        [SYS_PHYSMEM_UNMAP] = (syshandler_t) sys_physmem_unmap,
     180        [SYS_DMAMEM_MAP] = (syshandler_t) sys_dmamem_map,
     181        [SYS_DMAMEM_UNMAP] = (syshandler_t) sys_dmamem_unmap,
     182        [SYS_IOSPACE_ENABLE] = (syshandler_t) sys_iospace_enable,
     183        [SYS_IOSPACE_DISABLE] = (syshandler_t) sys_iospace_disable,
     184       
     185        [SYS_IPC_IRQ_SUBSCRIBE] = (syshandler_t) sys_ipc_irq_subscribe,
     186        [SYS_IPC_IRQ_UNSUBSCRIBE] = (syshandler_t) sys_ipc_irq_unsubscribe,
    188187       
    189188        /* Sysinfo syscalls. */
    190         (syshandler_t) sys_sysinfo_get_keys_size,
    191         (syshandler_t) sys_sysinfo_get_keys,
    192         (syshandler_t) sys_sysinfo_get_val_type,
    193         (syshandler_t) sys_sysinfo_get_value,
    194         (syshandler_t) sys_sysinfo_get_data_size,
    195         (syshandler_t) sys_sysinfo_get_data,
     189        [SYS_SYSINFO_GET_KEYS_SIZE] = (syshandler_t) sys_sysinfo_get_keys_size,
     190        [SYS_SYSINFO_GET_KEYS] = (syshandler_t) sys_sysinfo_get_keys,
     191        [SYS_SYSINFO_GET_VAL_TYPE] = (syshandler_t) sys_sysinfo_get_val_type,
     192        [SYS_SYSINFO_GET_VALUE] = (syshandler_t) sys_sysinfo_get_value,
     193        [SYS_SYSINFO_GET_DATA_SIZE] = (syshandler_t) sys_sysinfo_get_data_size,
     194        [SYS_SYSINFO_GET_DATA] = (syshandler_t) sys_sysinfo_get_data,
    196195       
    197196        /* Kernel console syscalls. */
    198         (syshandler_t) sys_debug_console,
    199        
    200         (syshandler_t) sys_klog,
     197        [SYS_DEBUG_CONSOLE] = (syshandler_t) sys_debug_console,
     198       
     199        [SYS_KLOG] = (syshandler_t) sys_klog,
    201200};
    202201
Note: See TracChangeset for help on using the changeset viewer.