Changeset f8ddd17 in mainline for kernel/generic/src/time/clock.c
- Timestamp:
- 2006-12-09T20:20:50Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b82a13c
- Parents:
- 9ab9c2ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/time/clock.c
r9ab9c2ec rf8ddd17 55 55 #include <sysinfo/sysinfo.h> 56 56 #include <arch/barrier.h> 57 #include <mm/frame.h> 58 #include <ddi/ddi.h> 59 60 /** Physical memory area of the real time clock. */ 61 static parea_t clock_parea; 57 62 58 63 /* Pointers to public variables with time */ … … 73 78 * information about realtime data. We allocate 1 page with these 74 79 * data and update it periodically. 75 *76 *77 80 */ 78 81 void clock_counter_init(void) … … 80 83 void *faddr; 81 84 82 faddr = frame_alloc( 0, FRAME_ATOMIC);85 faddr = frame_alloc(ONE_FRAME, FRAME_ATOMIC); 83 86 if (!faddr) 84 87 panic("Cannot allocate page for clock"); 85 88 86 public_time = (struct ptime *) PA2KA(faddr);89 public_time = (struct ptime *) PA2KA(faddr); 87 90 88 91 /* TODO: We would need some arch dependent settings here */ … … 91 94 public_time->useconds = 0; 92 95 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); 94 110 } 95 111
Note:
See TracChangeset
for help on using the changeset viewer.