Changeset f8ddd17 in mainline for kernel/generic/src/time/clock.c


Ignore:
Timestamp:
2006-12-09T20:20:50Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b82a13c
Parents:
9ab9c2ec
Message:

Rework support for virtually indexed cache.
Instead of repeatedly flushing the data cache, which was a huge overkill, refuse to create an illegal address alias
in the kernel (again) and allocate appropriate page color in userspace instead. Extend the detection also to
SYS_PHYSMEM_MAP syscall.

Add support for tracking physical memory areas mappable by SYS_PHYSMEM_MAP.

Lots of coding style changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/time/clock.c

    r9ab9c2ec rf8ddd17  
    5555#include <sysinfo/sysinfo.h>
    5656#include <arch/barrier.h>
     57#include <mm/frame.h>
     58#include <ddi/ddi.h>
     59
     60/** Physical memory area of the real time clock. */
     61static parea_t clock_parea;
    5762
    5863/* Pointers to public variables with time */
     
    7378 * information about realtime data. We allocate 1 page with these
    7479 * data and update it periodically.
    75  *
    76  *
    7780 */
    7881void clock_counter_init(void)
     
    8083        void *faddr;
    8184
    82         faddr = frame_alloc(0, FRAME_ATOMIC);
     85        faddr = frame_alloc(ONE_FRAME, FRAME_ATOMIC);
    8386        if (!faddr)
    8487                panic("Cannot allocate page for clock");
    8588       
    86         public_time = (struct ptime *)PA2KA(faddr);
     89        public_time = (struct ptime *) PA2KA(faddr);
    8790
    8891        /* TODO: We would need some arch dependent settings here */
     
    9194        public_time->useconds = 0;
    9295
    93         sysinfo_set_item_val("clock.faddr", NULL, (unative_t)faddr);
     96        clock_parea.pbase = (uintptr_t) faddr;
     97        clock_parea.vbase = (uintptr_t) public_time;
     98        clock_parea.frames = 1;
     99        clock_parea.cacheable = true;
     100        ddi_parea_register(&clock_parea);
     101
     102        /*
     103         * Prepare information for the userspace so that it can successfully
     104         * physmem_map() the clock_parea.
     105         */
     106        sysinfo_set_item_val("clock.cacheable", NULL, (unative_t) true);
     107        sysinfo_set_item_val("clock.fcolor", NULL, (unative_t)
     108                PAGE_COLOR(clock_parea.vbase));
     109        sysinfo_set_item_val("clock.faddr", NULL, (unative_t) faddr);
    94110}
    95111
Note: See TracChangeset for help on using the changeset viewer.