diff options
author | attilio <attilio@FreeBSD.org> | 2013-03-02 14:28:31 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-03-02 14:28:31 +0000 |
commit | 17028bb6ae721ddd816b0adf0ac7cfd240621017 (patch) | |
tree | 552ad8a1c4bf28f2e23a04234aeab7a5decc3899 /sys/i386 | |
parent | a815147cd7c785945e4c4bc79952f6102d52415d (diff) | |
parent | 5d33901b24a0ca4496b12ca2299df4b62dfdfd35 (diff) | |
download | FreeBSD-src-17028bb6ae721ddd816b0adf0ac7cfd240621017.zip FreeBSD-src-17028bb6ae721ddd816b0adf0ac7cfd240621017.tar.gz |
MFC
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/conf/GENERIC | 2 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 23 | ||||
-rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 7 | ||||
-rw-r--r-- | sys/i386/xen/clock.c | 26 |
4 files changed, 25 insertions, 33 deletions
diff --git a/sys/i386/conf/GENERIC b/sys/i386/conf/GENERIC index 47af43b..3a98ded 100644 --- a/sys/i386/conf/GENERIC +++ b/sys/i386/conf/GENERIC @@ -146,7 +146,7 @@ device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) device ses # Enclosure Services (SES and SAF-TE) -device ctl # CAM Target Layer +#device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 744c3cb..3f15f08 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -1220,7 +1220,7 @@ cpu_halt(void) int scheduler_running; static void -cpu_idle_hlt(int busy) +cpu_idle_hlt(sbintime_t sbt) { scheduler_running = 1; @@ -1241,7 +1241,7 @@ cpu_halt(void) #endif -void (*cpu_idle_hook)(void) = NULL; /* ACPI idle hook. */ +void (*cpu_idle_hook)(sbintime_t) = NULL; /* ACPI idle hook. */ static int cpu_ident_amdc1e = 0; /* AMD C1E supported. */ static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ TUNABLE_INT("machdep.idle_mwait", &idle_mwait); @@ -1253,7 +1253,7 @@ SYSCTL_INT(_machdep, OID_AUTO, idle_mwait, CTLFLAG_RW, &idle_mwait, #define STATE_SLEEPING 0x2 static void -cpu_idle_acpi(int busy) +cpu_idle_acpi(sbintime_t sbt) { int *state; @@ -1265,7 +1265,7 @@ cpu_idle_acpi(int busy) if (sched_runnable()) enable_intr(); else if (cpu_idle_hook) - cpu_idle_hook(); + cpu_idle_hook(sbt); else __asm __volatile("sti; hlt"); *state = STATE_RUNNING; @@ -1273,7 +1273,7 @@ cpu_idle_acpi(int busy) #ifndef XEN static void -cpu_idle_hlt(int busy) +cpu_idle_hlt(sbintime_t sbt) { int *state; @@ -1315,7 +1315,7 @@ cpu_idle_hlt(int busy) #define MWAIT_C4 0x30 static void -cpu_idle_mwait(int busy) +cpu_idle_mwait(sbintime_t sbt) { int *state; @@ -1338,7 +1338,7 @@ cpu_idle_mwait(int busy) } static void -cpu_idle_spin(int busy) +cpu_idle_spin(sbintime_t sbt) { int *state; int i; @@ -1388,9 +1388,9 @@ cpu_probe_amdc1e(void) } #ifdef XEN -void (*cpu_idle_fn)(int) = cpu_idle_hlt; +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_hlt; #else -void (*cpu_idle_fn)(int) = cpu_idle_acpi; +void (*cpu_idle_fn)(sbintime_t) = cpu_idle_acpi; #endif void @@ -1399,6 +1399,7 @@ cpu_idle(int busy) #ifndef XEN uint64_t msr; #endif + sbintime_t sbt = -1; CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); @@ -1418,7 +1419,7 @@ cpu_idle(int busy) /* If we have time - switch timers into idle mode. */ if (!busy) { critical_enter(); - cpu_idleclock(); + sbt = cpu_idleclock(); } #ifndef XEN @@ -1431,7 +1432,7 @@ cpu_idle(int busy) #endif /* Call main idle method. */ - cpu_idle_fn(busy); + cpu_idle_fn(sbt); /* Switch timers mack into active mode. */ if (!busy) { diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 0692122..9f382aa 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -337,8 +337,7 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) - if ((error = getvnode(td->td_proc->p_fd, uap->fd, - CAP_READ | CAP_SEEK, &fp)) != 0) + if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_READ, &fp)) != 0) return (error); if ((fp->f_flag & FREAD) == 0) { fdrop(fp, td); @@ -491,8 +490,8 @@ ibcs2_read(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; - if ((error = getvnode(td->td_proc->p_fd, uap->fd, - CAP_READ | CAP_SEEK, &fp)) != 0) { + if ((error = getvnode(td->td_proc->p_fd, uap->fd, CAP_READ, + &fp)) != 0) { if (error == EINVAL) return sys_read(td, (struct read_args *)uap); else diff --git a/sys/i386/xen/clock.c b/sys/i386/xen/clock.c index 4e43a12..a10b546 100644 --- a/sys/i386/xen/clock.c +++ b/sys/i386/xen/clock.c @@ -768,8 +768,7 @@ resettodr() #endif static int -xen_et_start(struct eventtimer *et, - struct bintime *first, struct bintime *period) +xen_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) { struct xen_et_state *state = DPCPU_PTR(et_state); struct shadow_time_info *shadow; @@ -777,21 +776,16 @@ xen_et_start(struct eventtimer *et, __get_time_values_from_xen(); - if (period != NULL) { + if (period != 0) { state->mode = MODE_PERIODIC; - state->period = (1000000000LL * - (uint32_t)(period->frac >> 32)) >> 32; - if (period->sec != 0) - state->period += 1000000000LL * period->sec; + state->period = (1000000000LLU * period) >> 32; } else { state->mode = MODE_ONESHOT; state->period = 0; } - if (first != NULL) { - fperiod = (1000000000LL * (uint32_t)(first->frac >> 32)) >> 32; - if (first->sec != 0) - fperiod += 1000000000LL * first->sec; - } else + if (first != 0) + fperiod = (1000000000LLU * first) >> 32; + else fperiod = state->period; shadow = &per_cpu(shadow_time, smp_processor_id()); @@ -832,11 +826,9 @@ cpu_initclocks(void) xen_et.et_flags = ET_FLAGS_PERIODIC | ET_FLAGS_ONESHOT | ET_FLAGS_PERCPU; xen_et.et_quality = 600; - xen_et.et_frequency = 0; - xen_et.et_min_period.sec = 0; - xen_et.et_min_period.frac = 0x00400000LL << 32; - xen_et.et_max_period.sec = 2; - xen_et.et_max_period.frac = 0; + xen_et.et_frequency = 1000000000; + xen_et.et_min_period = 0x00400000LL; + xen_et.et_max_period = (0xfffffffeLLU << 32) / xen_et.et_frequency; xen_et.et_start = xen_et_start; xen_et.et_stop = xen_et_stop; xen_et.et_priv = NULL; |