Changeset 7420


Ignore:
Timestamp:
Oct 12, 2007, 1:12:13 PM (12 years ago)
Author:
gb
Message:

Fix bogus definitions for getsockname and getpeername.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/linux-files.lisp

    r7308 r7420  
    13651365    (percentage-of-resident-pages address nbytes)))
    13661366 
     1367#+x86-target
     1368(progn
     1369(defloadvar *last-rdtsc-time* 0)
     1370
     1371(defstatic *rdtsc-estimated-increment* 1 "Should be positive ...")
     1372
     1373(defun rdtsc-monotonic ()
     1374  "Return monotonically increasing values, partly compensating for
     1375   OSes that don't keep the TSCs of all processorsin synch."
     1376  (loop
     1377    (let* ((old *last-rdtsc-time*)
     1378           (new (rdtsc)))
     1379      (when (< new old)
     1380        ;; We're running on a CPU whose TSC is behind the one
     1381        ;; on the last CPU we were scheduled on.
     1382        (setq new (+ old *rdtsc-estimated-increment*)))
     1383      (when (%store-node-conditional target::symbol.vcell *last-rdtsc-time* old new)
     1384        (return new)))))
     1385
     1386(defun estimate-rdtsc-skew (&optional (niter 1000000))
     1387  (do* ((i 0 (1+ i))
     1388        (last (rdtsc) next)
     1389        (next (rdtsc) (rdtsc))
     1390        (skew 1))
     1391       ((>= i niter) (setq *rdtsc-estimated-increment* skew))
     1392    (declare (fixnum last next skew))
     1393    (when (> last next)
     1394      (let* ((s (- last next)))
     1395        (declare (fixnum s))
     1396        (when (> s skew) (setq skew s))))))
     1397)
     1398
     1399
Note: See TracChangeset for help on using the changeset viewer.