Changeset 569 for trunk/kernel


Ignore:
Timestamp:
Oct 5, 2018, 12:06:26 AM (6 years ago)
Author:
alain
Message:

Introductioa of the soclib_mty driver for the TSAR-LETI architecture.n

Location:
trunk/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/Makefile

    r557 r569  
    88endif
    99
    10 #We choose drivers and hal file to be linked with kernel.elf
     10# We choose drivers and hal file to be linked with kernel.elf
    1111ifeq ($(ARCH_NAME), tsar_mips32)
    1212
    1313  DRIVERS_OBJS = $(HAL_ARCH)/build/drivers/soclib_tty.o  \
    14                  $(HAL_ARCH)/build/drivers/soclib_mtty.o \
     14                 $(HAL_ARCH)/build/drivers/soclib_mty.o \
    1515                 $(HAL_ARCH)/build/drivers/soclib_bdv.o  \
    1616                 $(HAL_ARCH)/build/drivers/soclib_hba.o  \
     
    7979
    8080# Objects to be linked for kernel.elf generation
    81 KERN_OBJS       = build/kern/kernel_init.o     \
    82               build/kern/printk.o          \
    83               build/kern/thread.o          \
    84               build/kern/process.o         \
    85               build/kern/chdev.o           \
    86               build/kern/cluster.o         \
    87               build/kern/scheduler.o       \
    88               build/kern/core.o            \
    89               build/kern/dqdt.o            \
    90               build/kern/do_syscall.o      \
     81KERN_OBJS       = build/kern/kernel_init.o      \
     82              build/kern/printk.o           \
     83              build/kern/thread.o           \
     84              build/kern/process.o          \
     85              build/kern/chdev.o            \
     86              build/kern/cluster.o          \
     87              build/kern/scheduler.o        \
     88              build/kern/core.o             \
     89              build/kern/dqdt.o             \
     90              build/kern/do_syscall.o       \
    9191              build/kern/rpc.o             \
    9292              build/kern/cluster_info.o
    9393
    94 DEV_OBJS    = build/devices/dev_txt.o      \
    95               build/devices/dev_ioc.o      \
    96               build/devices/dev_mmc.o      \
    97               build/devices/dev_nic.o      \
    98               build/devices/dev_pic.o      \
    99               build/devices/dev_dma.o      \
    100               build/devices/dev_fbf.o      \
     94DEV_OBJS    = build/devices/dev_txt.o       \
     95              build/devices/dev_ioc.o       \
     96              build/devices/dev_mmc.o       \
     97              build/devices/dev_nic.o       \
     98              build/devices/dev_pic.o       \
     99              build/devices/dev_dma.o       \
     100              build/devices/dev_fbf.o       \
    101101              build/devices/dev_iob.o
    102102
    103 MM_OBJS     = build/mm/ppm.o               \
    104               build/mm/vmm.o               \
    105               build/mm/vseg.o              \
    106               build/mm/page.o              \
    107               build/mm/kcm.o               \
    108               build/mm/khm.o               \
    109               build/mm/mapper.o            \
     103MM_OBJS     = build/mm/ppm.o                \
     104              build/mm/vmm.o                \
     105              build/mm/vseg.o               \
     106              build/mm/page.o               \
     107              build/mm/kcm.o                \
     108              build/mm/khm.o                \
     109              build/mm/mapper.o             \
    110110              build/mm/kmem.o
    111111
    112 LIBK_OBJS   = build/libk/grdxt.o           \
    113               build/libk/bits.o            \
    114               build/libk/elf.o             \
    115               build/libk/string.o          \
    116               build/libk/ctype.o           \
    117               build/libk/rwlock.o          \
    118               build/libk/spinlock.o        \
    119               build/libk/barrier.o         \
    120               build/libk/remote_barrier.o  \
    121               build/libk/remote_spinlock.o \
    122               build/libk/remote_rwlock.o   \
    123               build/libk/remote_fifo.o     \
    124               build/libk/remote_mutex.o    \
    125               build/libk/remote_sem.o      \
    126               build/libk/remote_condvar.o  \
    127               build/libk/memcpy.o          \
    128               build/libk/htab.o            \
     112LIBK_OBJS   = build/libk/grdxt.o            \
     113              build/libk/bits.o             \
     114              build/libk/elf.o              \
     115              build/libk/string.o           \
     116              build/libk/ctype.o            \
     117              build/libk/rwlock.o           \
     118              build/libk/busylock.o         \
     119              build/libk/queuelock.o        \
     120              build/libk/barrier.o          \
     121              build/libk/xbarrier.o         \
     122              build/libk/remote_busylock.o  \
     123              build/libk/remote_queuelock.o \
     124              build/libk/remote_rwlock.o    \
     125              build/libk/remote_fifo.o      \
     126              build/libk/remote_mutex.o     \
     127              build/libk/remote_sem.o       \
     128              build/libk/remote_condvar.o   \
     129              build/libk/remote_barrier.o   \
     130              build/libk/memcpy.o           \
     131              build/libk/htab.o             \
    129132              build/libk/xhtab.o
    130133
  • trunk/kernel/kernel_config.h

    r557 r569  
    2424 */
    2525
    26 #ifndef _ALMOS_CONFIG_H_
    27 #define _ALMOS_CONFIG_H_
     26#ifndef _KERNEL_CONFIG_H_
     27#define _KERNEL_CONFIG_H_
    2828
    2929#define CONFIG_ALMOS_VERSION           "Version 1.0 / August 2018"
     
    3636////////////////////////////////////////////////////////////////////////////////////////////
    3737
     38#define DEBUG_BUSYLOCK                 0
     39#define DEBUG_BUSYLOCK_THREAD_XP       0x3A000ULL    // selected thread_xp
     40                 
    3841#define DEBUG_CHDEV_CMD_RX             0
    3942#define DEBUG_CHDEV_CMD_TX             0
     
    8386
    8487#define DEBUG_KERNEL_INIT              0
    85 #define DEBUG_KMEM_ALLOC               0
    8688
    8789#define DEBUG_MAPPER_GET_PAGE          0
    8890#define DEBUG_MAPPER_MOVE_USER         0
    8991#define DEBUG_MAPPER_MOVE_KERNEL       0
     92
     93#define DEBUG_MUTEX                    0
    9094
    9195#define DEBUG_PPM_ALLOC_PAGES          0
     
    103107#define DEBUG_PROCESS_ZERO_CREATE      0
    104108
     109#define DEBUG_QUEUELOCK                0
     110
    105111#define DEBUG_RPC_CLIENT_GENERIC       0
    106112#define DEBUG_RPC_SERVER_GENERIC       0
    107113
     114#define DEBUG_RPC_KCM_ALLOC            0
     115#define DEBUG_RPC_KCM_FREE             0
    108116#define DEBUG_RPC_PMEM_GET_PAGES       0
    109117#define DEBUG_RPC_PMEM_RELEASE_PAGES   0
    110118#define DEBUG_RPC_PROCESS_MAKE_FORK    0
    111119#define DEBUG_RPC_PROCESS_SIGACTION    0
     120#define DEBUG_RPC_THREAD_USER_CREATE   0
     121#define DEBUG_RPC_THREAD_KERNEL_CREATE 0
    112122#define DEBUG_RPC_VFS_INODE_CREATE     0
    113123#define DEBUG_RPC_VFS_INODE_DESTROY    0
     
    119129#define DEBUG_RPC_VMM_GET_VSEG         0
    120130
    121 #define DEBUG_SCHED_HANDLE_SIGNALS     2
     131#define DEBUG_RWLOCK                   0
     132
     133#define DEBUG_SCHED_HANDLE_SIGNALS     0
    122134#define DEBUG_SCHED_YIELD              2    // must be activated by the trace() syscall
     135#define DEBUG_SCHED_RPC_CHECK          0
     136
     137#define DEBUG_SEM                      0
    123138
    124139#define DEBUG_SYSCALLS_ERROR           2
    125140
    126141#define DEBUG_SYS_CLOSE                0
     142#define DEBUG_SYS_CONDVAR              0
    127143#define DEBUG_SYS_DISPLAY              0
    128144#define DEBUG_SYS_EXEC                 0
     
    131147#define DEBUG_SYS_FORK                 0
    132148#define DEBUG_SYS_GET_CONFIG           0
     149#define DEBUG_SYS_GETPID               0
    133150#define DEBUG_SYS_ISATTY               0
    134151#define DEBUG_SYS_IS_FG                0
     
    137154#define DEBUG_SYS_MMAP                 0
    138155#define DEBUG_SYS_MUNMAP               0
     156#define DEBUG_SYS_MUTEX                0
    139157#define DEBUG_SYS_READ                 0
     158#define DEBUG_SYS_SEM                  0
    140159#define DEBUG_SYS_THREAD_CANCEL        0
    141160#define DEBUG_SYS_THREAD_CREATE        0
     
    148167#define DEBUG_SYS_WAIT                 0
    149168#define DEBUG_SYS_WRITE                0
    150 #define DEBUG_SYS_SEM                  0
    151169
    152170#define DEBUG_SPINLOCKS                0
     
    155173#define DEBUG_REMOTE_RWLOCKS           0
    156174
     175#define DEBUG_THREAD_DELETE            0
    157176#define DEBUG_THREAD_DESTROY           0
    158177#define DEBUG_THREAD_IDLE              0
    159178#define DEBUG_THREAD_INIT              0
    160179#define DEBUG_THREAD_KERNEL_CREATE     0
    161 #define DEBUG_THREAD_KILL              0
    162180#define DEBUG_THREAD_USER_CREATE       0
    163181#define DEBUG_THREAD_USER_FORK         0
     
    165183#define DEBUG_THREAD_BLOCK             0
    166184
     185#define DEBUG_VFS_ADD_CHILD            0
    167186#define DEBUG_VFS_CLOSE                0
     187#define DEBUG_VFS_DENTRY_CREATE        0
    168188#define DEBUG_VFS_INODE_CREATE         0
    169189#define DEBUG_VFS_INODE_LOAD           0
    170 #define DEBUG_VFS_DENTRY_CREATE        0
    171 #define DEBUG_VFS_OPEN                 0
    172190#define DEBUG_VFS_LOOKUP               0
    173 #define DEBUG_VFS_ADD_CHILD            0
    174191#define DEBUG_VFS_MAPPER_MOVE          0
    175192#define DEBUG_VFS_MAPPER_LOAD          0
     193#define DEBUG_VFS_OPEN                 0
    176194
    177195#define DEBUG_VMM_CREATE_VSEG          0
     
    187205#define DEBUG_VMM_UPDATE_PTE           0
    188206
     207#define DEBUG_XHTAB                    0
     208
     209
     210////////////////////////////////////////////////////////////////////////////////////////////
     211//                KERNEL LOCKS TYPES MNEMONICS (for debug)
     212// It must be kept consistent with the lock_name[] array defined in kernel_init.c file.
     213////////////////////////////////////////////////////////////////////////////////////////////
     214
     215#define LOCK_CLUSTER_KCM       1   // local  (B)  protect dynamic KCM creation in cluster
     216#define LOCK_PPM_FREE          2   // local  (B)  protect PPM allocator free_pages lists
     217#define LOCK_SCHED_STATE       3   // local  (B)  protect scheduler state for given core
     218#define LOCK_VMM_STACK         4   // local  (B)  protect VMM stack vseg allocator   
     219#define LOCK_VMM_MMAP          5   // local  (B)  protect VMM mmap vseg allocator
     220#define LOCK_VFS_CTX           6   // local  (B)  protect vfs context state
     221#define LOCK_KCM_STATE         7   // local  (B)  protect KCM allocator state
     222#define LOCK_KHM_STATE         8   // local  (B)  protect KHM allocator state
     223#define LOCK_HTAB_STATE        9   // local  (B)  protect a local htab state
     224
     225#define LOCK_THREAD_JOIN      10   // remote (B)  protect join/exit between two threads
     226#define LOCK_VFS_MAIN         11   // remote (B)  protect vfs traversal (one per inode)
     227#define LOCK_CHDEV_QUEUE      12   // remote (B)  protect chdev threads waiting queue
     228#define LOCK_CHDEV_TXT0       13   // remote (B)  protect access to kernel terminal TXT0
     229#define LOCK_CHDEV_TXTLIST    14   // remote (B)  protect xlist of processes using same TXT
     230#define LOCK_PAGE_STATE       15   // remote (B)  protect physical page descriptor state
     231#define LOCK_MUTEX_STATE      16   // remote (B)  protect user mutex state
     232#define LOCK_CONDVAR_STATE    17   // remote (B)  protect user condvar state
     233#define LOCK_SEM_STATE        18   // remote (B)  protect user semaphore state
     234#define LOCK_XHTAB_STATE      19   // remote (B)  protect a distributed xhatb state
     235
     236#define BUSYLOCK_TYPE_MAX     20
     237
     238#define LOCK_CLUSTER_PREFTBL  21   // local  (Q)  protect array of ref. processes in cluster
     239#define LOCK_PPM_DIRTY        22   // local  (Q)  protect PPM dirty_pages list
     240
     241#define LOCK_CLUSTER_LOCALS   23   // remote (Q)  protect xlist of local processes in cluster
     242#define LOCK_CLUSTER_COPIES   24   // remote (Q)  protect xlist of process copies in cluster
     243#define LOCK_PROCESS_CHILDREN 25   // remote (Q)  protect xlist of chidren process in process
     244#define LOCK_PROCESS_USERSYNC 26   // remote (Q)  protect all lists of user synchros in  process
     245#define LOCK_PROCESS_FDARRAY  27   // remote (Q)  protect array of open files in owner process
     246
     247#define LOCK_MAPPER_STATE     28   // local  (RW) protect mapper state
     248#define LOCK_PROCESS_THTBL    29   // local  (RW) protect local array of threads in a process
     249
     250#define LOCK_PROCESS_CWD      30   // remote (RW) protect current working directory in process
     251#define LOCK_VFS_INODE        31   // remote (RW) protect inode state and associated mapper
     252#define LOCK_VFS_FILE         32   // remote (RW) protect file descriptor state
     253#define LOCK_VMM_VSL          33   // remote (RW) protect VSL (local list of vsegs)
     254
    189255////////////////////////////////////////////////////////////////////////////////////////////
    190256//                          HARDWARE CONFIGURATION     
     
    192258
    193259#define CONFIG_KERNEL_IDENTITY_MAP          true       // True for 32 bits cores             
    194 #define CONFIG_MAX_CLUSTERS_X               16         // max number of cluster columns
    195 #define CONFIG_MAX_CLUSTERS_Y               16         // max number of cluster rows
    196 #define CONFIG_MAX_CLUSTERS                 (CONFIG_MAX_CLUSTERS_X * CONFIG_MAX_CLUSTERS_Y)
     260#define CONFIG_MAX_CLUSTERS_X               16         // max number of clusters in row
     261#define CONFIG_MAX_CLUSTERS_Y               16         // max number of clusters in column
     262#define CONFIG_MAX_CLUSTERS                 (CONFIG_MAX_CLUSTERS_X * CONFIG_MAX_CLUSTERS_Y) 
    197263#define CONFIG_MAX_LOCAL_CORES              4          // max number of cores per cluster
    198264#define CONFIG_MAX_INT_DEV                  4          // max number of internal peripherals
    199265#define CONFIG_MAX_EXT_DEV                  8          // max number of external peripherals
    200 #define CONFIG_MAX_INTERNAL_IRQS            32         // max number of HWI per ICU
    201 #define CONFIG_MAX_EXTERNAL_IRQS            32         // max number of PTI per ICU
     266#define CONFIG_MAX_INTERNAL_IRQS            32         // max number of internal IRQs
     267#define CONFIG_MAX_EXTERNAL_IRQS            32         // max number of external IRQs
    202268#define CONFIG_IRQS_PER_CORE                4          // number of input IRQs per core
    203269#define CONFIG_CLUSTER_SPAN                 32         // ln(phys. address space per cluster)
     
    245311
    246312////////////////////////////////////////////////////////////////////////////////////////////
    247 //                                 LOCKS         
    248 ////////////////////////////////////////////////////////////////////////////////////////////
    249 
    250 #define CONFIG_RWLOCK_DELAY                 50       // iterations number ( ~ 200 cycles )
    251 
    252 ////////////////////////////////////////////////////////////////////////////////////////////
    253313//                                  DQDT       
    254314////////////////////////////////////////////////////////////////////////////////////////////
     
    276336////////////////////////////////////////////////////////////////////////////////////////////
    277337
    278 #define CONFIG_THREAD_MAX_PER_CLUSTER       16      // max threads per cluster & process
     338#define CONFIG_THREADS_MAX_PER_CLUSTER      16      // max threads per cluster & process
    279339#define CONFIG_THREAD_DESC_SIZE             0x4000  // thread desc size (with kernel stack)
    280340#define CONFIG_THREAD_DESC_ORDER            2       // ln( number of 4K pages )
     
    333393
    334394
    335 
    336 ////////////////////////////////////////////////////////////////////////////////////////////
    337 //    deprecated
    338 ////////////////////////////////////////////////////////////////////////////////////////////
    339 
    340 #define CONFIG_DMA_RQ_KCM_MIN         2
    341 #define CONFIG_DMA_RQ_KCM_MAX         4
    342 #define CONFIG_TASK_KCM_MIN           2
    343 #define CONFIG_TASK_KCM_MAX           3
    344 #define CONFIG_FDINFO_KCM_MIN         2
    345 #define CONFIG_FDINFO_KCM_MAX         2
    346 #define CONFIG_DEVFS_CTX_MIN          1
    347 #define CONFIG_DEVFS_CTX_MAX          1
    348 #define CONFIG_DEVFS_FILE_MIN         2
    349 #define CONFIG_DEVFS_FILE_MAX         3
    350 #define CONFIG_DEVFS_NODE_MIN         1
    351 #define CONFIG_DEVFS_NODE_MAX         2
    352 #define CONFIG_VFAT_CTX_MIN           1
    353 #define CONFIG_VFAT_CTX_MAX           1
    354 
    355 #define CONFIG_RAMFS_FILE_MIN         3
    356 #define CONFIG_RAMFS_FILE_MAX         3
    357 
    358 #define CONFIG_VFAT_FILE_MIN          3
    359 #define CONFIG_VFAT_FILE_MAX          3
    360 #define CONFIG_VFAT_NODE_MIN          2
    361 #define CONFIG_VFAT_NODE_MAX          2
    362 
    363 #define CONFIG_EXT2_CTX_MIN           1
    364 #define CONFIG_EXT2_CTX_MAX           1
    365 #define CONFIG_EXT2_FILE_MIN          3
    366 #define CONFIG_EXT2_FILE_MAX          3
    367 #define CONFIG_EXT2_NODE_MIN          2
    368 #define CONFIG_EXT2_NODE_MAX          2
    369 
    370 #define CONFIG_VFS_CTX_MIN            1
    371 #define CONFIG_VFS_CTX_MAX            1
    372 #define CONFIG_VFS_INODE_MIN          3
    373 #define CONFIG_VFS_INODE_MAX          6
    374 #define CONFIG_VFS_FILE_MIN           3
    375 #define CONFIG_VFS_FILE_MAX           5
    376 
    377 #define CONFIG_SEMAPHORE_MIN          2
    378 #define CONFIG_SEMAPHORE_MAX          2
    379 #define CONFIG_CONDTION_VAR_MIN       2
    380 #define CONFIG_CONDTION_VAR_MAX       2
    381 #define CONFIG_BARRIER_MIN            2
    382 #define CONFIG_BARRIER_MAX            2
    383 #define CONFIG_RWLOCK_MIN             2
    384 #define CONFIG_RWLOCK_MAX             2
    385 #define CONFIG_WAITQUEUEDB_MAX        2
    386 #define CONFIG_WAITQUEUEDB_MIN        2
    387 #define CONFIG_RADIX_NODE_MIN         10         
    388 #define CONFIG_RADIX_NODE_MAX         30
    389 #define CONFIG_VM_REGION_MIN          1
    390 #define CONFIG_VM_REGION_MAX          2
    391 #define CONFIG_BLKIO_MIN              4
    392 #define CONFIG_BLKIO_MAX              8
    393 #define CONFIG_KEYREC_MIN             2
    394 #define CONFIG_KEYREC_MAX             2
     395////////////////////////////////////////////////////////////////////////////////////////////
     396//                 INSTRUMENTATION
     397////////////////////////////////////////////////////////////////////////////////////////////
     398
     399#define CONFIG_INTRUMENTATION_SYSCALLS  0
     400
     401
    395402
    396403
Note: See TracChangeset for help on using the changeset viewer.