Changeset fd8302d in mainline


Ignore:
Timestamp:
2006-05-28T22:26:00Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a449065
Parents:
a6cb8cb
Message:

Correct realtime clock communication.

Location:
generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • generic/include/print.h

    ra6cb8cb rfd8302d  
    3939#define EOF (-1)
    4040
    41 extern int puts(const char * str);
    42 
    4341extern int printf(const char *fmt, ...);
    4442extern int sprintf(char *str, const char *fmt, ...);
  • generic/src/time/clock.c

    ra6cb8cb rfd8302d  
    5454/* Pointers to public variables with time */
    5555struct ptime {
    56         __native seconds;
     56        __native seconds1;
    5757        __native useconds;
    58         __native useconds2;
     58        __native seconds2;
    5959};
    6060struct ptime *public_time;
     
    8383
    8484        /* TODO: We would need some arch dependent settings here */
    85         public_time->seconds = 0;
     85        public_time->seconds1 = 0;
     86        public_time->seconds2 = 0;
    8687        public_time->useconds = 0;
    8788
     
    100101                secfrag += 1000000/HZ;
    101102                if (secfrag >= 1000000) {
    102                         public_time->useconds = 0;
     103                        secfrag -= 1000000;
     104                        public_time->seconds1++;
    103105                        write_barrier();
    104                         public_time->seconds++;
    105                         secfrag = 0;
     106                        public_time->useconds = secfrag;
     107                        write_barrier();
     108                        public_time->seconds2 = public_time->seconds1;
    106109                } else
    107110                        public_time->useconds += 1000000/HZ;
    108                 write_barrier();
    109                 public_time->useconds2 = public_time->useconds;
    110                 write_barrier();
    111111        }
    112112}
Note: See TracChangeset for help on using the changeset viewer.