} bin[RANDOM_SOURCES];
};
+/* ARM free-running timer information. */
+struct arm_frclock {
+ u64_t hz; /* tcrr frequency */
+ u32_t tcrr; /* tcrr address */
+};
+
struct minix_kerninfo {
/* Binaries will depend on the offsets etc. in this
* structure, so it can't be changed willy-nilly. In
u32_t kerninfo_magic;
u32_t minix_feature_flags; /* features in minix kernel */
u32_t ki_flags; /* what is present in this struct */
- u32_t minix_frclock_tcrr; /* NOT userland ABI */
+ u32_t flags_unused2;
u32_t flags_unused3;
u32_t flags_unused4;
struct kinfo *kinfo;
struct kmessages *kmessages; /* NOT userland ABI */
struct loadinfo *loadinfo; /* NOT userland ABI */
struct minix_ipcvecs *minix_ipcvecs;
- u64_t minix_arm_frclock_hz; /* minix_frclock_tcrr frequency !ABI */
+ u32_t reserved;
+ struct arm_frclock *arm_frclock; /* NOT userland ABI */
volatile struct kclockinfo *kclockinfo; /* NOT userland ABI */
} __packed;
/* the only thing we need to do at this stage is to set the address */
/* in the kerninfo struct */
if (BOARD_IS_BBXM(machine.board_id)) {
- minix_kerninfo.minix_frclock_tcrr = address + OMAP3_TIMER_TCRR;
- minix_kerninfo.minix_arm_frclock_hz = 1625000;
+ arm_frclock.tcrr = address + OMAP3_TIMER_TCRR;
+ arm_frclock.hz = 1625000;
} else if (BOARD_IS_BB(machine.board_id)) {
- minix_kerninfo.minix_frclock_tcrr =
- address + AM335X_TIMER_TCRR;
- minix_kerninfo.minix_arm_frclock_hz = 1500000;
+ arm_frclock.tcrr = address + AM335X_TIMER_TCRR;
+ arm_frclock.hz = 1500000;
}
return 0;
}
ASSIGN(machine);
ASSIGN(kmessages);
ASSIGN(loadinfo);
+ ASSIGN(arm_frclock);
ASSIGN(kclockinfo);
/* adjust the pointers of the functions and the struct
ASSIGN(machine);
ASSIGN(kmessages);
ASSIGN(loadinfo);
+ ASSIGN(arm_frclock); /* eh, why not. */
ASSIGN(kclockinfo);
/* select the right set of IPC routines to map into processes */
extern struct machine machine; /* machine information for users */
extern struct kmessages kmessages; /* diagnostic messages in kernel */
extern struct loadinfo loadinfo; /* status of load average */
+extern struct arm_frclock arm_frclock; /* ARM free-running timer info */
extern struct kclockinfo kclockinfo; /* clock information */
extern struct minix_kerninfo minix_kerninfo;
strlcpy(kinfo.release, OS_RELEASE, sizeof(kinfo.release));
strlcpy(kinfo.version, OS_VERSION, sizeof(kinfo.version));
+ /* Initialize various user-mapped structures. */
+ memset(&arm_frclock, 0, sizeof(arm_frclock));
+
#ifdef USE_APIC
value = env_get("no_apic");
if(value)
struct machine machine __section(".usermapped"); /* machine information for users */
struct kmessages kmessages __section(".usermapped"); /* diagnostic messages in kernel */
struct loadinfo loadinfo __section(".usermapped"); /* status of load average */
+struct arm_frclock arm_frclock __section(".usermapped");
+ /* ARM free running timer information */
struct kclockinfo kclockinfo __section(".usermapped"); /* clock information */
/* Start of delay. */
read_frclock_64(&start);
- assert(minix_kerninfo->minix_arm_frclock_hz);
- delta_end = (minix_kerninfo->minix_arm_frclock_hz * micros) / MICROHZ;
+ assert(minix_kerninfo->arm_frclock);
+ assert(minix_kerninfo->arm_frclock->hz);
+ delta_end = (minix_kerninfo->arm_frclock->hz * micros) / MICROHZ;
/* If we have to wait for at least one HZ tick, use the regular
* tickdelay first. Round downwards on purpose, so the average
u32_t frclock_64_to_micros(u64_t tsc)
{
return (u32_t)
- (tsc / (get_minix_kerninfo()->minix_arm_frclock_hz / MICROHZ));
+ (tsc / (get_minix_kerninfo()->arm_frclock->hz / MICROHZ));
}
void
struct minix_kerninfo *minix_kerninfo = get_minix_kerninfo();
assert(frclk);
- assert(minix_kerninfo->minix_frclock_tcrr);
- assert(minix_kerninfo->minix_arm_frclock_hz);
+ assert(minix_kerninfo->arm_frclock);
+ assert(minix_kerninfo->arm_frclock->tcrr);
*frclk = *(volatile u32_t *)((u8_t *)
- minix_kerninfo->minix_frclock_tcrr);
+ minix_kerninfo->arm_frclock->tcrr);
}
u32_t