Changeset d0a0f12 in mainline


Ignore:
Timestamp:
2006-02-10T14:12:57Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0882a9a
Parents:
a3eeceb6
Message:

Make ASID FIFO for mips32 be allocated statically.
Make ASID FIFO for sparc64 and ia64 be allocated dynamically.
Fix ia64 to call asid_fifo_init().
All three architectures now call asid_fifo_init() from as_arch_init().

Files:
7 edited

Legend:

Unmodified
Added
Removed
  • arch/ia64/src/mm/as.c

    ra3eeceb6 rd0a0f12  
    2929#include <arch/mm/as.h>
    3030#include <genarch/mm/as_ht.h>
     31#include <genarch/mm/asid_fifo.h>
    3132
    3233/** Architecture dependent address space init. */
     
    3435{
    3536        as_operations = &as_ht_operations;
     37        asid_fifo_init();
    3638}
  • arch/mips32/src/mm/as.c

    ra3eeceb6 rd0a0f12  
    2929#include <arch/mm/as.h>
    3030#include <genarch/mm/as_pt.h>
     31#include <genarch/mm/asid_fifo.h>
    3132#include <arch/mm/tlb.h>
    3233#include <mm/tlb.h>
     
    3940{
    4041        as_operations = &as_pt_operations;
     42        asid_fifo_init();
    4143}
    4244
  • arch/mips32/src/mm/tlb.c

    ra3eeceb6 rd0a0f12  
    2929#include <arch/mm/tlb.h>
    3030#include <mm/asid.h>
    31 #include <genarch/mm/asid_fifo.h>
    3231#include <mm/tlb.h>
    3332#include <mm/page.h>
     
    5857{
    5958        int i;
    60 
    61         asid_fifo_init();
    6259
    6360        cp0_pagemask_write(TLB_PAGE_MASK_16K);
  • arch/sparc64/src/mm/as.c

    ra3eeceb6 rd0a0f12  
    2929#include <arch/mm/as.h>
    3030#include <genarch/mm/as_ht.h>
     31#include <genarch/mm/asid_fifo.h>
    3132
    3233/** Architecture dependent address space init. */
     
    3435{
    3536        as_operations = &as_ht_operations;
     37        asid_fifo_init();
    3638}
  • arch/sparc64/src/mm/tlb.c

    ra3eeceb6 rd0a0f12  
    2929#include <arch/mm/tlb.h>
    3030#include <mm/tlb.h>
    31 #include <genarch/mm/asid_fifo.h>
    3231#include <arch/mm/frame.h>
    3332#include <arch/mm/page.h>
     
    5655        frame_address_t fr;
    5756        page_address_t pg;
    58 
    59         asid_fifo_init();
    6057
    6158        fr.address = config.base;
  • genarch/src/mm/asid_fifo.c

    ra3eeceb6 rd0a0f12  
    3333#include <adt/fifo.h>
    3434
     35#define FIFO_STATIC_LIMIT       1024
     36#define FIFO_STATIC             (ASIDS_ALLOCABLE<FIFO_STATIC_LIMIT)
    3537/**
    3638 * FIFO queue containing unassigned ASIDs.
    3739 * Can be only accessed when asidlock is held.
    3840 */
    39 FIFO_INITIALIZE(free_asids, asid_t, ASIDS_ALLOCABLE);
     41#if FIFO_STATIC
     42FIFO_INITIALIZE_STATIC(free_asids, asid_t, ASIDS_ALLOCABLE);
     43#else
     44FIFO_INITIALIZE_DYNAMIC(free_asids, asid_t, ASIDS_ALLOCABLE);
     45#endif
    4046
    4147/** Initialize data structures for O(1) ASID allocation and deallocation. */
     
    4349{
    4450        int i;
    45        
     51
     52        #if (!FIFO_STATIC)
     53        fifo_create(free_asids);
     54        #endif
     55               
    4656        for (i = 0; i < ASIDS_ALLOCABLE; i++) {
    4757                fifo_push(free_asids, ASID_START + i);
  • generic/include/adt/fifo.h

    ra3eeceb6 rd0a0f12  
    2828
    2929/*
    30  * This implementation of FIFO stores values in a statically
    31  * allocated array created on each FIFO's initialization.
    32  * As such, these FIFOs have upper bound on number of values
    33  * they can store. Push and pop operations are done via accessing
    34  * the array through head and tail indices. Because of better
    35  * operation ordering in fifo_pop(), the access policy for these
    36  * two indices is to 'increment (mod size of FIFO) and use'.
     30 * This implementation of FIFO stores values in an array
     31 * (static or dynamic). As such, these FIFOs have upper bound
     32 * on number of values they can store. Push and pop operations
     33 * are done via accessing the array through head and tail indices.
     34 * Because of better operation ordering in fifo_pop(), the access
     35 * policy for these two indices is to 'increment (mod size of FIFO)
     36 * and use'.
    3737 */
    3838
     
    4141
    4242#include <typedefs.h>
     43#include <mm/slab.h>
    4344
    44 /** Create and initialize FIFO.
     45/** Create and initialize static FIFO.
     46 *
     47 * FIFO is allocated statically.
     48 * This macro is suitable for creating smaller FIFOs.
    4549 *
    4650 * @param name Name of FIFO.
     
    4852 * @param itms Number of items that can be stored in FIFO.
    4953 */
    50 #define FIFO_INITIALIZE(name, t, itms)                  \
     54#define FIFO_INITIALIZE_STATIC(name, t, itms)           \
    5155        struct {                                        \
    5256                t fifo[(itms)];                         \
     
    5559                index_t tail;                           \
    5660        } name = {                                      \
     61                .items = (itms),                        \
     62                .head = 0,                              \
     63                .tail = 0                               \
     64        }
     65
     66/** Create and prepare dynamic FIFO.
     67 *
     68 * FIFO is allocated dynamically.
     69 * This macro is suitable for creating larger FIFOs.
     70 *
     71 * @param name Name of FIFO.
     72 * @param t Type of values stored in FIFO.
     73 * @param itms Number of items that can be stored in FIFO.
     74 */
     75#define FIFO_INITIALIZE_DYNAMIC(name, t, itms)          \
     76        struct {                                        \
     77                t *fifo;                                \
     78                count_t items;                          \
     79                index_t head;                           \
     80                index_t tail;                           \
     81        } name = {                                      \
     82                .fifo = NULL,                           \
    5783                .items = (itms),                        \
    5884                .head = 0,                              \
     
    78104        name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value)
    79105
     106/** Allocate memory for dynamic FIFO.
     107 *
     108 * @param name FIFO name.
     109 */
     110#define fifo_create(name) \
     111        name.fifo = malloc(sizeof(*name.fifo) * name.items, 0)
     112
    80113#endif
Note: See TracChangeset for help on using the changeset viewer.