time.c (0612ec48762bf8712db1925b2e67246d2237ebab) | time.c (a4dc7ff08915a2035aa6d6decc53fa1deaa410bb) |
---|---|
1/* 2 * Common time routines among all ppc machines. 3 * 4 * Written by Cort Dougan (cort@cs.nmt.edu) to merge 5 * Paul Mackerras' version and mine for PReP and Pmac. 6 * MPC8xx/MBX changes by Dan Malek (dmalek@jlc.net). 7 * Converted for 64-bit by Mike Corrigan (mikejc@us.ibm.com) 8 * --- 846 unchanged lines hidden (view full) --- 855 return 0; 856} 857 858EXPORT_SYMBOL(do_settimeofday); 859 860static int __init get_freq(char *name, int cells, unsigned long *val) 861{ 862 struct device_node *cpu; | 1/* 2 * Common time routines among all ppc machines. 3 * 4 * Written by Cort Dougan (cort@cs.nmt.edu) to merge 5 * Paul Mackerras' version and mine for PReP and Pmac. 6 * MPC8xx/MBX changes by Dan Malek (dmalek@jlc.net). 7 * Converted for 64-bit by Mike Corrigan (mikejc@us.ibm.com) 8 * --- 846 unchanged lines hidden (view full) --- 855 return 0; 856} 857 858EXPORT_SYMBOL(do_settimeofday); 859 860static int __init get_freq(char *name, int cells, unsigned long *val) 861{ 862 struct device_node *cpu; |
863 unsigned int *fp; | 863 const unsigned int *fp; |
864 int found = 0; 865 866 /* The cpu node should have timebase and clock frequency properties */ 867 cpu = of_find_node_by_type(NULL, "cpu"); 868 869 if (cpu) { | 864 int found = 0; 865 866 /* The cpu node should have timebase and clock frequency properties */ 867 cpu = of_find_node_by_type(NULL, "cpu"); 868 869 if (cpu) { |
870 fp = (unsigned int *)get_property(cpu, name, NULL); | 870 fp = get_property(cpu, name, NULL); |
871 if (fp) { 872 found = 1; | 871 if (fp) { 872 found = 1; |
873 *val = 0; 874 while (cells--) 875 *val = (*val << 32) | *fp++; | 873 *val = of_read_ulong(fp, cells); |
876 } 877 878 of_node_put(cpu); 879 } 880 881 return found; 882} 883 --- 314 unchanged lines hidden --- | 874 } 875 876 of_node_put(cpu); 877 } 878 879 return found; 880} 881 --- 314 unchanged lines hidden --- |