···1+2+ CPU frequency and voltage scaling statictics in the Linux(TM) kernel3+4+5+ L i n u x c p u f r e q - s t a t s d r i v e r6+7+ - information for users -8+9+10+ Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>11+12+Contents13+1. Introduction14+2. Statistics Provided (with example)15+3. Configuring cpufreq-stats16+17+18+1. Introduction19+20+cpufreq-stats is a driver that provices CPU frequency statistics for each CPU.21+This statistics is provided in /sysfs as a bunch of read_only interfaces. This22+interface (when configured) will appear in a seperate directory under cpufreq23+in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU.24+Various statistics will form read_only files under this directory.25+26+This driver is designed to be independent of any particular cpufreq_driver27+that may be running on your CPU. So, it will work with any cpufreq_driver.28+29+30+2. Statistics Provided (with example)31+32+cpufreq stats provides following statistics (explained in detail below).33+- time_in_state34+- total_trans35+- trans_table36+37+All the statistics will be from the time the stats driver has been inserted 38+to the time when a read of a particular statistic is done. Obviously, stats 39+driver will not have any information about the the frequcny transitions before40+the stats driver insertion.41+42+--------------------------------------------------------------------------------43+<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l44+total 045+drwxr-xr-x 2 root root 0 May 14 16:06 .46+drwxr-xr-x 3 root root 0 May 14 15:58 ..47+-r--r--r-- 1 root root 4096 May 14 16:06 time_in_state48+-r--r--r-- 1 root root 4096 May 14 16:06 total_trans49+-r--r--r-- 1 root root 4096 May 14 16:06 trans_table50+--------------------------------------------------------------------------------51+52+- time_in_state53+This gives the amount of time spent in each of the frequencies supported by54+this CPU. The cat output will have "<frequency> <time>" pair in each line, which55+will mean this CPU spent <time> usertime units of time at <frequency>. Output56+will have one line for each of the supported freuencies. usertime units here 57+is 10mS (similar to other time exported in /proc).58+59+--------------------------------------------------------------------------------60+<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat time_in_state 61+3600000 208962+3400000 13663+3200000 3464+3000000 6765+2800000 17248866+--------------------------------------------------------------------------------67+68+69+- total_trans70+This gives the total number of frequency transitions on this CPU. The cat 71+output will have a single count which is the total number of frequency72+transitions.73+74+--------------------------------------------------------------------------------75+<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat total_trans76+2077+--------------------------------------------------------------------------------78+79+- trans_table80+This will give a fine grained information about all the CPU frequency81+transitions. The cat output here is a two dimensional matrix, where an entry82+<i,j> (row i, column j) represents the count of number of transitions from 83+Freq_i to Freq_j. Freq_i is in descending order with increasing rows and 84+Freq_j is in descending order with increasing columns. The output here also 85+contains the actual freq values for each row and column for better readability.86+87+--------------------------------------------------------------------------------88+<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat trans_table89+ From : To90+ : 3600000 3400000 3200000 3000000 2800000 91+ 3600000: 0 5 0 0 0 92+ 3400000: 4 0 2 0 0 93+ 3200000: 0 1 0 2 0 94+ 3000000: 0 0 1 0 3 95+ 2800000: 0 0 0 2 0 96+--------------------------------------------------------------------------------97+98+99+3. Configuring cpufreq-stats100+101+To configure cpufreq-stats in your kernel102+Config Main Menu103+ Power management options (ACPI, APM) --->104+ CPU Frequency scaling --->105+ [*] CPU Frequency scaling106+ <*> CPU frequency translation statistics 107+ [*] CPU frequency translation statistics details108+109+110+"CPU Frequency scaling" (CONFIG_CPU_FREQ) should be enabled to configure111+cpufreq-stats.112+113+"CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT) provides the114+basic statistics which includes time_in_state and total_trans.115+116+"CPU frequency translation statistics details" (CONFIG_CPU_FREQ_STAT_DETAILS)117+provides fine grained cpufreq stats by trans_table. The reason for having a118+seperate config option for trans_table is:119+- trans_table goes against the traditional /sysfs rule of one value per120+ interface. It provides a whole bunch of value in a 2 dimensional matrix121+ form.122+123+Once these two options are enabled and your CPU supports cpufrequency, you124+will be able to see the CPU frequency statistics in /sysfs.125+126+127+128+
···54void default_idle(void)55{56 while(1) {57- if (need_resched()) {58 local_irq_enable();59 __asm__("sleep");60 local_irq_disable();
···54void default_idle(void)55{56 while(1) {57+ if (!need_resched()) {58 local_irq_enable();59 __asm__("sleep");60 local_irq_disable();
+13-1
arch/i386/kernel/cpu/cpufreq/Kconfig
···23 If in doubt, say N.2425config ELAN_CPUFREQ26- tristate "AMD Elan"27 select CPU_FREQ_TABLE28 depends on X86_ELAN29 ---help---···37 For details, take a look at <file:Documentation/cpu-freq/>.3839 If in doubt, say N.0000000000004041config X86_POWERNOW_K642 tristate "AMD Mobile K6-2/K6-3 PowerNow!"
···23 If in doubt, say N.2425config ELAN_CPUFREQ26+ tristate "AMD Elan SC400 and SC410"27 select CPU_FREQ_TABLE28 depends on X86_ELAN29 ---help---···37 For details, take a look at <file:Documentation/cpu-freq/>.3839 If in doubt, say N.40+41+config SC520_CPUFREQ42+ tristate "AMD Elan SC520"43+ select CPU_FREQ_TABLE44+ depends on X86_ELAN45+ ---help---46+ This adds the CPUFreq driver for AMD Elan SC520 processor.47+48+ For details, take a look at <file:Documentation/cpu-freq/>.49+50+ If in doubt, say N.51+5253config X86_POWERNOW_K654 tristate "AMD Mobile K6-2/K6-3 PowerNow!"
···29#include <linux/cpufreq.h>30#include <linux/slab.h>31#include <linux/string.h>32+#include <linux/pci.h>3334#include <asm/msr.h>35#include <asm/timex.h>···119static void do_powersaver(union msr_longhaul *longhaul,120 unsigned int clock_ratio_index)121{122+ struct pci_dev *dev;123+ unsigned long flags;124+ unsigned int tmp_mask;125 int version;126+ int i;127+ u16 pci_cmd;128+ u16 cmd_state[64];129130 switch (cpu_model) {131 case CPU_EZRA_T:···137 longhaul->bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4;138 longhaul->bits.EnableSoftBusRatio = 1;139 longhaul->bits.RevisionKey = 0;140+141+ preempt_disable();142+ local_irq_save(flags);143+144+ /*145+ * get current pci bus master state for all devices146+ * and clear bus master bit147+ */148+ dev = NULL;149+ i = 0;150+ do {151+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);152+ if (dev != NULL) {153+ pci_read_config_word(dev, PCI_COMMAND, &pci_cmd);154+ cmd_state[i++] = pci_cmd;155+ pci_cmd &= ~PCI_COMMAND_MASTER;156+ pci_write_config_word(dev, PCI_COMMAND, pci_cmd);157+ }158+ } while (dev != NULL);159+160+ tmp_mask=inb(0x21); /* works on C3. save mask. */161+ outb(0xFE,0x21); /* TMR0 only */162+ outb(0xFF,0x80); /* delay */163+164 local_irq_enable();165+166+ __hlt();167+ wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);168 __hlt();169170+ local_irq_disable();171+172+ outb(tmp_mask,0x21); /* restore mask */173+174+ /* restore pci bus master state for all devices */175+ dev = NULL;176+ i = 0;177+ do {178+ dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev);179+ if (dev != NULL) {180+ pci_cmd = cmd_state[i++];181+ pci_write_config_byte(dev, PCI_COMMAND, pci_cmd);182+ }183+ } while (dev != NULL);184+ local_irq_restore(flags);185+ preempt_enable();186+187+ /* disable bus ratio bit */188 rdmsrl(MSR_VIA_LONGHAUL, longhaul->val);189 longhaul->bits.EnableSoftBusRatio = 0;190 longhaul->bits.RevisionKey = version;0191 wrmsrl(MSR_VIA_LONGHAUL, longhaul->val);0192}193194/**···578 longhaul_setup_voltagescaling();579580 policy->governor = CPUFREQ_DEFAULT_GOVERNOR;581+ policy->cpuinfo.transition_latency = 200000; /* nsec */582 policy->cur = calc_speed(longhaul_get_cpu_mult());583584 ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table);
+8-3
arch/i386/kernel/cpu/cpufreq/powernow-k7.c
···23#include <linux/dmi.h>2425#include <asm/msr.h>026#include <asm/timex.h>27#include <asm/io.h>28#include <asm/system.h>···587588 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);589590- /* A K7 with powernow technology is set to max frequency by BIOS */591- fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.MFID];0000592 if (!fsb) {593 printk(KERN_WARNING PFX "can not determine bus frequency\n");594 return -EINVAL;595 }596- dprintk("FSB: %3d.%03d MHz\n", fsb/1000, fsb%1000);597598 if (dmi_check_system(powernow_dmi_table) || acpi_force) {599 printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n");
···23#include <linux/dmi.h>2425#include <asm/msr.h>26+#include <asm/timer.h>27#include <asm/timex.h>28#include <asm/io.h>29#include <asm/system.h>···586587 rdmsrl (MSR_K7_FID_VID_STATUS, fidvidstatus.val);588589+ /* recalibrate cpu_khz */590+ result = recalibrate_cpu_khz();591+ if (result)592+ return result;593+594+ fsb = (10 * cpu_khz) / fid_codes[fidvidstatus.bits.CFID];595 if (!fsb) {596 printk(KERN_WARNING PFX "can not determine bus frequency\n");597 return -EINVAL;598 }599+ dprintk("FSB: %3dMHz\n", fsb/1000);600601 if (dmi_check_system(powernow_dmi_table) || acpi_force) {602 printk (KERN_INFO PFX "PSB/PST known to be broken. Trying ACPI instead\n");
+76-37
arch/i386/kernel/cpu/cpufreq/powernow-k8.c
···4 * GNU general public license version 2. See "COPYING" or5 * http://www.gnu.org/licenses/gpl.html6 *7- * Support : paul.devriendt@amd.com8 *9 * Based on the powernow-k7.c module written by Dave Jones.10 * (C) 2003 Dave Jones <davej@codemonkey.org.uk> on behalf of SuSE Labs···15 *16 * Valuable input gratefully received from Dave Jones, Pavel Machek,17 * Dominik Brodowski, and others.018 * Processor information obtained from Chapter 9 (Power and Thermal Management)19 * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD20 * Opteron Processors" available for download from www.amd.com21 *22 * Tables for specific CPUs can be infrerred from23- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf24 */2526#include <linux/kernel.h>···31#include <linux/cpufreq.h>32#include <linux/slab.h>33#include <linux/string.h>03435#include <asm/msr.h>36#include <asm/io.h>···4445#define PFX "powernow-k8: "46#define BFX PFX "BIOS error: "47-#define VERSION "version 1.00.09e"48#include "powernow-k8.h"4950/* serialize freq changes */51static DECLARE_MUTEX(fidvid_sem);5253static struct powernow_k8_data *powernow_data[NR_CPUS];00005455/* Return a frequency in MHz, given an input fid */56static u32 find_freq_from_fid(u32 fid)···280{281 u32 rvosteps = data->rvo;282 u32 savefid = data->currfid;0283284 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",285 smp_processor_id(),286 data->currfid, data->currvid, reqvid, data->rvo);000000287288 while (data->currvid > reqvid) {289 dprintk("ph1: curr 0x%x, req vid 0x%x\n",···299 return 1;300 }301302- while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) {303- if (data->currvid == 0) {304 rvosteps = 0;305 } else {306 dprintk("ph1: changing vid for rvo, req 0x%x\n",···684 * BIOS and Kernel Developer's Guide, which is available on685 * www.amd.com686 */687- printk(KERN_ERR PFX "BIOS error - no PSB\n");688 return -ENODEV;689}690···708 struct cpufreq_frequency_table *powernow_table;709710 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {711- dprintk("register performance failed\n");712 return -EIO;713 }714···759 continue;760 }761762- if (fid < HI_FID_TABLE_BOTTOM) {763- if (cntlofreq) {764- /* if both entries are the same, ignore this765- * one... 766- */767- if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||768- (powernow_table[i].index != powernow_table[cntlofreq].index)) {769- printk(KERN_ERR PFX "Too many lo freq table entries\n");770- goto err_out_mem;771- }772-773- dprintk("double low frequency table entry, ignoring it.\n");774- powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;775- continue;776- } else777- cntlofreq = i;0778 }779780 if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {···830{831 u32 fid;832 u32 vid;833- int res;834 struct cpufreq_freqs freqs;835836 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);···855 }856857 if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) {858- printk("ignoring illegal change in lo freq table-%x to 0x%x\n",0859 data->currfid, fid);860 return 1;861 }···865 smp_processor_id(), fid, vid);866867 freqs.cpu = data->cpu;868-869 freqs.old = find_khz_freq_from_fid(data->currfid);870 freqs.new = find_khz_freq_from_fid(fid);871- cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);000872873- down(&fidvid_sem);874 res = transition_fid_vid(data, fid, vid);875- up(&fidvid_sem);876877 freqs.new = find_khz_freq_from_fid(data->currfid);878- cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);879-00880 return res;881}882···891 u32 checkvid = data->currvid;892 unsigned int newstate;893 int ret = -EIO;0894895 /* only run on specific CPU from here on */896 oldmask = current->cpus_allowed;···920 data->currfid, data->currvid);921922 if ((checkvid != data->currvid) || (checkfid != data->currfid)) {923- printk(KERN_ERR PFX924- "error - out of sync, fid 0x%x 0x%x, vid 0x%x 0x%x\n",925- checkfid, data->currfid, checkvid, data->currvid);926 }927928 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))929 goto err_out;00000000000930931 powernow_k8_acpi_pst_values(data, newstate);932933 if (transition_frequency(data, newstate)) {934 printk(KERN_ERR PFX "transition frequency failed\n");935 ret = 1;0936 goto err_out;937 }0000000938939 pol->cur = find_khz_freq_from_fid(data->currfid);940 ret = 0;···999 */10001001 if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {1002- printk(KERN_INFO PFX "MP systems not supported by PSB BIOS structure\n");1003 kfree(data);1004 return -ENODEV;1005 }···1040 schedule();10411042 pol->governor = CPUFREQ_DEFAULT_GOVERNOR;010431044 /* Take a crude guess here. 1045 * That guess was in microseconds, so multiply with 1000 */···1107 return 0;1108 }1109 preempt_disable();1110-1111 if (query_current_values_with_pending_wait(data))1112 goto out;1113···1165 cpufreq_unregister_driver(&cpufreq_amd64_driver);1166}11671168-MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com>");1169MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");1170MODULE_LICENSE("GPL");11711172late_initcall(powernowk8_init);1173module_exit(powernowk8_exit);0
···4 * GNU general public license version 2. See "COPYING" or5 * http://www.gnu.org/licenses/gpl.html6 *7+ * Support : mark.langsdorf@amd.com8 *9 * Based on the powernow-k7.c module written by Dave Jones.10 * (C) 2003 Dave Jones <davej@codemonkey.org.uk> on behalf of SuSE Labs···15 *16 * Valuable input gratefully received from Dave Jones, Pavel Machek,17 * Dominik Brodowski, and others.18+ * Originally developed by Paul Devriendt.19 * Processor information obtained from Chapter 9 (Power and Thermal Management)20 * of the "BIOS and Kernel Developer's Guide for the AMD Athlon 64 and AMD21 * Opteron Processors" available for download from www.amd.com22 *23 * Tables for specific CPUs can be infrerred from24+ * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/30430.pdf25 */2627#include <linux/kernel.h>···30#include <linux/cpufreq.h>31#include <linux/slab.h>32#include <linux/string.h>33+#include <linux/cpumask.h>3435#include <asm/msr.h>36#include <asm/io.h>···4243#define PFX "powernow-k8: "44#define BFX PFX "BIOS error: "45+#define VERSION "version 1.40.2"46#include "powernow-k8.h"4748/* serialize freq changes */49static DECLARE_MUTEX(fidvid_sem);5051static struct powernow_k8_data *powernow_data[NR_CPUS];52+53+#ifndef CONFIG_SMP54+static cpumask_t cpu_core_map[1];55+#endif5657/* Return a frequency in MHz, given an input fid */58static u32 find_freq_from_fid(u32 fid)···274{275 u32 rvosteps = data->rvo;276 u32 savefid = data->currfid;277+ u32 maxvid, lo;278279 dprintk("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",280 smp_processor_id(),281 data->currfid, data->currvid, reqvid, data->rvo);282+283+ rdmsr(MSR_FIDVID_STATUS, lo, maxvid);284+ maxvid = 0x1f & (maxvid >> 16);285+ dprintk("ph1 maxvid=0x%x\n", maxvid);286+ if (reqvid < maxvid) /* lower numbers are higher voltages */287+ reqvid = maxvid;288289 while (data->currvid > reqvid) {290 dprintk("ph1: curr 0x%x, req vid 0x%x\n",···286 return 1;287 }288289+ while ((rvosteps > 0) && ((data->rvo + data->currvid) > reqvid)) {290+ if (data->currvid == maxvid) {291 rvosteps = 0;292 } else {293 dprintk("ph1: changing vid for rvo, req 0x%x\n",···671 * BIOS and Kernel Developer's Guide, which is available on672 * www.amd.com673 */674+ printk(KERN_INFO PFX "BIOS error - no PSB or ACPI _PSS objects\n");675 return -ENODEV;676}677···695 struct cpufreq_frequency_table *powernow_table;696697 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {698+ dprintk("register performance failed: bad ACPI data\n");699 return -EIO;700 }701···746 continue;747 }748749+ /* verify only 1 entry from the lo frequency table */750+ if (fid < HI_FID_TABLE_BOTTOM) {751+ if (cntlofreq) {752+ /* if both entries are the same, ignore this753+ * one... 754+ */755+ if ((powernow_table[i].frequency != powernow_table[cntlofreq].frequency) ||756+ (powernow_table[i].index != powernow_table[cntlofreq].index)) {757+ printk(KERN_ERR PFX "Too many lo freq table entries\n");758+ goto err_out_mem;759+ }760+761+ dprintk("double low frequency table entry, ignoring it.\n");762+ powernow_table[i].frequency = CPUFREQ_ENTRY_INVALID;763+ continue;764+ } else765+ cntlofreq = i;766 }767768 if (powernow_table[i].frequency != (data->acpi_data.states[i].core_frequency * 1000)) {···816{817 u32 fid;818 u32 vid;819+ int res, i;820 struct cpufreq_freqs freqs;821822 dprintk("cpu %d transition to index %u\n", smp_processor_id(), index);···841 }842843 if ((fid < HI_FID_TABLE_BOTTOM) && (data->currfid < HI_FID_TABLE_BOTTOM)) {844+ printk(KERN_ERR PFX845+ "ignoring illegal change in lo freq table-%x to 0x%x\n",846 data->currfid, fid);847 return 1;848 }···850 smp_processor_id(), fid, vid);851852 freqs.cpu = data->cpu;0853 freqs.old = find_khz_freq_from_fid(data->currfid);854 freqs.new = find_khz_freq_from_fid(fid);855+ for_each_cpu_mask(i, cpu_core_map[data->cpu]) {856+ freqs.cpu = i;857+ cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);858+ }8590860 res = transition_fid_vid(data, fid, vid);0861862 freqs.new = find_khz_freq_from_fid(data->currfid);863+ for_each_cpu_mask(i, cpu_core_map[data->cpu]) {864+ freqs.cpu = i;865+ cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);866+ }867 return res;868}869···874 u32 checkvid = data->currvid;875 unsigned int newstate;876 int ret = -EIO;877+ int i;878879 /* only run on specific CPU from here on */880 oldmask = current->cpus_allowed;···902 data->currfid, data->currvid);903904 if ((checkvid != data->currvid) || (checkfid != data->currfid)) {905+ printk(KERN_INFO PFX906+ "error - out of sync, fix 0x%x 0x%x, vid 0x%x 0x%x\n",907+ checkfid, data->currfid, checkvid, data->currvid);908 }909910 if (cpufreq_frequency_table_target(pol, data->powernow_table, targfreq, relation, &newstate))911 goto err_out;912+913+ down(&fidvid_sem);914+915+ for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {916+ /* make sure the sibling is initialized */917+ if (!powernow_data[i]) {918+ ret = 0;919+ up(&fidvid_sem);920+ goto err_out;921+ }922+ }923924 powernow_k8_acpi_pst_values(data, newstate);925926 if (transition_frequency(data, newstate)) {927 printk(KERN_ERR PFX "transition frequency failed\n");928 ret = 1;929+ up(&fidvid_sem);930 goto err_out;931 }932+933+ /* Update all the fid/vids of our siblings */934+ for_each_cpu_mask(i, cpu_core_map[pol->cpu]) {935+ powernow_data[i]->currvid = data->currvid;936+ powernow_data[i]->currfid = data->currfid;937+ } 938+ up(&fidvid_sem);939940 pol->cur = find_khz_freq_from_fid(data->currfid);941 ret = 0;···962 */963964 if ((num_online_cpus() != 1) || (num_possible_cpus() != 1)) {965+ printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");966 kfree(data);967 return -ENODEV;968 }···1003 schedule();10041005 pol->governor = CPUFREQ_DEFAULT_GOVERNOR;1006+ pol->cpus = cpu_core_map[pol->cpu];10071008 /* Take a crude guess here. 1009 * That guess was in microseconds, so multiply with 1000 */···1069 return 0;1070 }1071 preempt_disable();1072+1073 if (query_current_values_with_pending_wait(data))1074 goto out;1075···1127 cpufreq_unregister_driver(&cpufreq_amd64_driver);1128}11291130+MODULE_AUTHOR("Paul Devriendt <paul.devriendt@amd.com> and Mark Langsdorf <mark.langsdorf@amd.com.");1131MODULE_DESCRIPTION("AMD Athlon 64 and Opteron processor frequency driver.");1132MODULE_LICENSE("GPL");11331134late_initcall(powernowk8_init);1135module_exit(powernowk8_exit);1136+
+15
arch/i386/kernel/cpu/cpufreq/powernow-k8.h
···174static int core_frequency_transition(struct powernow_k8_data *data, u32 reqfid);175176static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned int index);000000000000000
···336 if (!prev_speed)337 return -EIO;338339- dprintk("previous seped is %u\n", prev_speed);340341 local_irq_save(flags);342···348 goto out;349 }350351- dprintk("low seped is %u\n", *low_speed);352353 /* switch to high state */354 set_state(SPEEDSTEP_HIGH);···358 goto out;359 }360361- dprintk("high seped is %u\n", *high_speed);362363 if (*low_speed == *high_speed) {364 ret = -ENODEV;
···336 if (!prev_speed)337 return -EIO;338339+ dprintk("previous speed is %u\n", prev_speed);340341 local_irq_save(flags);342···348 goto out;349 }350351+ dprintk("low speed is %u\n", *low_speed);352353 /* switch to high state */354 set_state(SPEEDSTEP_HIGH);···358 goto out;359 }360361+ dprintk("high speed is %u\n", *high_speed);362363 if (*low_speed == *high_speed) {364 ret = -ENODEV;
+3
arch/i386/kernel/cpu/cpufreq/speedstep-smi.c
···357 case SPEEDSTEP_PROCESSOR_PIII_C:358 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:359 break;000360 default:361 speedstep_processor = 0;362 }
···357 case SPEEDSTEP_PROCESSOR_PIII_C:358 case SPEEDSTEP_PROCESSOR_PIII_C_EARLY:359 break;360+ case SPEEDSTEP_PROCESSOR_P4M:361+ printk(KERN_INFO "speedstep-smi: you're trying to use this cpufreq driver on a Pentium 4-based CPU. Most likely it will not work.\n");362+ break;363 default:364 speedstep_processor = 0;365 }
+1-1
arch/i386/kernel/cpu/intel_cacheinfo.c
···118};119120#define MAX_CACHE_LEAVES 4121-static unsigned short __devinitdata num_cache_leaves;122123static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)124{
···118};119120#define MAX_CACHE_LEAVES 4121+static unsigned short num_cache_leaves;122123static int __devinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)124{
+2
arch/i386/kernel/setup.c
···1502 if (efi_enabled)1503 efi_map_memmap();150401505 /*1506 * Parse the ACPI tables for possible boot-time SMP configuration.1507 */1508 acpi_boot_table_init();1509 acpi_boot_init();015101511#ifdef CONFIG_X86_LOCAL_APIC1512 if (smp_found_config)
···1502 if (efi_enabled)1503 efi_map_memmap();15041505+#ifdef CONFIG_ACPI_BOOT1506 /*1507 * Parse the ACPI tables for possible boot-time SMP configuration.1508 */1509 acpi_boot_table_init();1510 acpi_boot_init();1511+#endif15121513#ifdef CONFIG_X86_LOCAL_APIC1514 if (smp_found_config)
+3-1
arch/i386/kernel/smpboot.c
···1074 cpu_set(cpu, cpu_sibling_map[cpu]);1075 }10761077- if (siblings != smp_num_siblings)1078 printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings);0010791080 if (c->x86_num_cores > 1) {1081 for (i = 0; i < NR_CPUS; i++) {
···1074 cpu_set(cpu, cpu_sibling_map[cpu]);1075 }10761077+ if (siblings != smp_num_siblings) {1078 printk(KERN_WARNING "WARNING: %d siblings found for CPU%d, should be %d\n", siblings, cpu, smp_num_siblings);1079+ smp_num_siblings = siblings;1080+ }10811082 if (c->x86_num_cores > 1) {1083 for (i = 0; i < NR_CPUS; i++) {
+4-2
arch/i386/kernel/timers/common.c
···6#include <linux/timex.h>7#include <linux/errno.h>8#include <linux/jiffies.h>0910#include <asm/io.h>11#include <asm/timer.h>···2526#define CALIBRATE_TIME (5 * 1000020/HZ)2728-unsigned long __init calibrate_tsc(void)29{30 mach_prepare_counter();31···140#endif141142/* calculate cpu_khz */143-void __init init_cpu_khz(void)144{145 if (cpu_has_tsc) {146 unsigned long tsc_quotient = calibrate_tsc();···159 }160 }161}0
···6#include <linux/timex.h>7#include <linux/errno.h>8#include <linux/jiffies.h>9+#include <linux/module.h>1011#include <asm/io.h>12#include <asm/timer.h>···2425#define CALIBRATE_TIME (5 * 1000020/HZ)2627+unsigned long calibrate_tsc(void)28{29 mach_prepare_counter();30···139#endif140141/* calculate cpu_khz */142+void init_cpu_khz(void)143{144 if (cpu_has_tsc) {145 unsigned long tsc_quotient = calibrate_tsc();···158 }159 }160}161+
···2427{2428 struct epoll_event *events64 = NULL;2429 mm_segment_t old_fs = get_fs();2430- int error, numevents, size;2431 int evt_idx;2432 int do_free_pages = 0;2433
···2427{2428 struct epoll_event *events64 = NULL;2429 mm_segment_t old_fs = get_fs();2430+ int numevents, size;2431 int evt_idx;2432 int do_free_pages = 0;2433
+2-2
arch/ia64/kernel/entry.S
···1182 ;;1183(pNonSys) mov out2=0 // out2==0 => not a syscall1184 .fframe 161185- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)1186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch1188 .body···1208 adds out2=8,sp // out2=&sigscratch->ar_pfs1209 ;;1210 .fframe 161211- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)1212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch1214 .body
···1182 ;;1183(pNonSys) mov out2=0 // out2==0 => not a syscall1184 .fframe 161185+ .spillsp ar.unat, 161186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch1188 .body···1208 adds out2=8,sp // out2=&sigscratch->ar_pfs1209 ;;1210 .fframe 161211+ .spillsp ar.unat, 161212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch1214 .body
+4-4
arch/ia64/kernel/mca.c
···1103 return IRQ_HANDLED;1104}11051106-#endif /* CONFIG_ACPI */1107-1108/*1109 * ia64_mca_cpe_poll1110 *···1119 /* Trigger a CPE interrupt cascade */1120 platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);1121}0011221123/*1124 * C portion of the OS INIT handler···1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);13911392#ifdef CONFIG_ACPI1393- /* Setup the CPEI/P vector and handler */1394- cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);1395 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);1396#endif1397···14351436#ifdef CONFIG_ACPI1437 /* Setup the CPEI/P vector and handler */01438 init_timer(&cpe_poll_timer);1439 cpe_poll_timer.function = ia64_mca_cpe_poll;1440
···1103 return IRQ_HANDLED;1104}1105001106/*1107 * ia64_mca_cpe_poll1108 *···1121 /* Trigger a CPE interrupt cascade */1122 platform_send_ipi(first_cpu(cpu_online_map), IA64_CPEP_VECTOR, IA64_IPI_DM_INT, 0);1123}1124+1125+#endif /* CONFIG_ACPI */11261127/*1128 * C portion of the OS INIT handler···1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);13911392#ifdef CONFIG_ACPI1393+ /* Setup the CPEI/P handler */01394 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);1395#endif1396···14361437#ifdef CONFIG_ACPI1438 /* Setup the CPEI/P vector and handler */1439+ cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);1440 init_timer(&cpe_poll_timer);1441 cpe_poll_timer.function = ia64_mca_cpe_poll;1442
+1-2
arch/ia64/kernel/minstate.h
···41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \42(pKStk) ld8 r3 = [r3];; \43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \44-(pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \47 ;; \···50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \52 ;; \53-(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \54(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \55 ;; \56(pUStk) mov r18=ar.bsp; \
···41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \42(pKStk) ld8 r3 = [r3];; \43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \44+(pKStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \47 ;; \···50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \52 ;; \053(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \54 ;; \55(pUStk) mov r18=ar.bsp; \
+160-15
arch/ia64/kernel/perfmon.c
···11 * Version Perfmon-2.x is a rewrite of perfmon-1.x12 * by Stephane Eranian, Hewlett Packard Co.13 *14- * Copyright (C) 1999-2003, 2005 Hewlett Packard Co15 * Stephane Eranian <eranian@hpl.hp.com>16 * David Mosberger-Tang <davidm@hpl.hp.com>17 *···497static pfm_stats_t pfm_stats[NR_CPUS];498static pfm_session_t pfm_sessions; /* global sessions information */499000500static struct proc_dir_entry *perfmon_dir;501static pfm_uuid_t pfm_null_uuid = {0,};502···609DEFINE_PER_CPU(struct task_struct *, pmu_owner);610DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);611DEFINE_PER_CPU(unsigned long, pmu_activation_number);0612613614/* forward declaration */···1329error_conflict:1330 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",1331 pfm_sessions.pfs_sys_session[cpu]->pid,1332- smp_processor_id()));1333abort:1334 UNLOCK_PFS(flags);1335···5559 int ret;55605561 this_cpu = get_cpu();5562- min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;5563- max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;055645565- start_cycles = ia64_get_itc();55665567- ret = pfm_do_interrupt_handler(irq, arg, regs);55685569- total_cycles = ia64_get_itc();55705571- /*5572- * don't measure spurious interrupts5573- */5574- if (likely(ret == 0)) {5575- total_cycles -= start_cycles;55765577- if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles;5578- if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles;55795580- pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;05581 }00005582 put_cpu_no_resched();5583 return IRQ_HANDLED;5584}···6434 .flags = SA_INTERRUPT,6435 .name = "perfmon"6436};00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064376438/*6439 * perfmon initialization routine, called from the initcall() table
···11 * Version Perfmon-2.x is a rewrite of perfmon-1.x12 * by Stephane Eranian, Hewlett Packard Co.13 *14+ * Copyright (C) 1999-2005 Hewlett Packard Co15 * Stephane Eranian <eranian@hpl.hp.com>16 * David Mosberger-Tang <davidm@hpl.hp.com>17 *···497static pfm_stats_t pfm_stats[NR_CPUS];498static pfm_session_t pfm_sessions; /* global sessions information */499500+static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED;501+static pfm_intr_handler_desc_t *pfm_alt_intr_handler;502+503static struct proc_dir_entry *perfmon_dir;504static pfm_uuid_t pfm_null_uuid = {0,};505···606DEFINE_PER_CPU(struct task_struct *, pmu_owner);607DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);608DEFINE_PER_CPU(unsigned long, pmu_activation_number);609+EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info);610611612/* forward declaration */···1325error_conflict:1326 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",1327 pfm_sessions.pfs_sys_session[cpu]->pid,1328+ cpu));1329abort:1330 UNLOCK_PFS(flags);1331···5555 int ret;55565557 this_cpu = get_cpu();5558+ if (likely(!pfm_alt_intr_handler)) {5559+ min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min;5560+ max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max;55615562+ start_cycles = ia64_get_itc();55635564+ ret = pfm_do_interrupt_handler(irq, arg, regs);55655566+ total_cycles = ia64_get_itc();55675568+ /*5569+ * don't measure spurious interrupts5570+ */5571+ if (likely(ret == 0)) {5572+ total_cycles -= start_cycles;55735574+ if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles;5575+ if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles;55765577+ pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;5578+ }5579 }5580+ else {5581+ (*pfm_alt_intr_handler->handler)(irq, arg, regs);5582+ }5583+5584 put_cpu_no_resched();5585 return IRQ_HANDLED;5586}···6424 .flags = SA_INTERRUPT,6425 .name = "perfmon"6426};6427+6428+static void6429+pfm_alt_save_pmu_state(void *data)6430+{6431+ struct pt_regs *regs;6432+6433+ regs = ia64_task_regs(current);6434+6435+ DPRINT(("called\n"));6436+6437+ /*6438+ * should not be necessary but6439+ * let's take not risk6440+ */6441+ pfm_clear_psr_up();6442+ pfm_clear_psr_pp();6443+ ia64_psr(regs)->pp = 0;6444+6445+ /*6446+ * This call is required6447+ * May cause a spurious interrupt on some processors6448+ */6449+ pfm_freeze_pmu();6450+6451+ ia64_srlz_d();6452+}6453+6454+void6455+pfm_alt_restore_pmu_state(void *data)6456+{6457+ struct pt_regs *regs;6458+6459+ regs = ia64_task_regs(current);6460+6461+ DPRINT(("called\n"));6462+6463+ /*6464+ * put PMU back in state expected6465+ * by perfmon6466+ */6467+ pfm_clear_psr_up();6468+ pfm_clear_psr_pp();6469+ ia64_psr(regs)->pp = 0;6470+6471+ /*6472+ * perfmon runs with PMU unfrozen at all times6473+ */6474+ pfm_unfreeze_pmu();6475+6476+ ia64_srlz_d();6477+}6478+6479+int6480+pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)6481+{6482+ int ret, i;6483+ int reserve_cpu;6484+6485+ /* some sanity checks */6486+ if (hdl == NULL || hdl->handler == NULL) return -EINVAL;6487+6488+ /* do the easy test first */6489+ if (pfm_alt_intr_handler) return -EBUSY;6490+6491+ /* one at a time in the install or remove, just fail the others */6492+ if (!spin_trylock(&pfm_alt_install_check)) {6493+ return -EBUSY;6494+ }6495+6496+ /* reserve our session */6497+ for_each_online_cpu(reserve_cpu) {6498+ ret = pfm_reserve_session(NULL, 1, reserve_cpu);6499+ if (ret) goto cleanup_reserve;6500+ }6501+6502+ /* save the current system wide pmu states */6503+ ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 0, 1);6504+ if (ret) {6505+ DPRINT(("on_each_cpu() failed: %d\n", ret));6506+ goto cleanup_reserve;6507+ }6508+6509+ /* officially change to the alternate interrupt handler */6510+ pfm_alt_intr_handler = hdl;6511+6512+ spin_unlock(&pfm_alt_install_check);6513+6514+ return 0;6515+6516+cleanup_reserve:6517+ for_each_online_cpu(i) {6518+ /* don't unreserve more than we reserved */6519+ if (i >= reserve_cpu) break;6520+6521+ pfm_unreserve_session(NULL, 1, i);6522+ }6523+6524+ spin_unlock(&pfm_alt_install_check);6525+6526+ return ret;6527+}6528+EXPORT_SYMBOL_GPL(pfm_install_alt_pmu_interrupt);6529+6530+int6531+pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl)6532+{6533+ int i;6534+ int ret;6535+6536+ if (hdl == NULL) return -EINVAL;6537+6538+ /* cannot remove someone else's handler! */6539+ if (pfm_alt_intr_handler != hdl) return -EINVAL;6540+6541+ /* one at a time in the install or remove, just fail the others */6542+ if (!spin_trylock(&pfm_alt_install_check)) {6543+ return -EBUSY;6544+ }6545+6546+ pfm_alt_intr_handler = NULL;6547+6548+ ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 0, 1);6549+ if (ret) {6550+ DPRINT(("on_each_cpu() failed: %d\n", ret));6551+ }6552+6553+ for_each_online_cpu(i) {6554+ pfm_unreserve_session(NULL, 1, i);6555+ }6556+6557+ spin_unlock(&pfm_alt_install_check);6558+6559+ return 0;6560+}6561+EXPORT_SYMBOL_GPL(pfm_remove_alt_pmu_interrupt);65626563/*6564 * perfmon initialization routine, called from the initcall() table
+17-3
arch/ia64/kernel/ptrace.c
···692 unsigned long cfm)693{694 struct unw_frame_info info, prev_info;695- unsigned long ip, pr;696697 unw_init_from_blocked_task(&info, child);698 while (1) {699 prev_info = info;700 if (unw_unwind(&info) < 0)701 return;702- if (unw_get_rp(&info, &ip) < 0)00000703 return;704- if (ip < FIXADDR_USER_END)000000000705 break;706 }707
···692 unsigned long cfm)693{694 struct unw_frame_info info, prev_info;695+ unsigned long ip, sp, pr;696697 unw_init_from_blocked_task(&info, child);698 while (1) {699 prev_info = info;700 if (unw_unwind(&info) < 0)701 return;702+703+ unw_get_sp(&info, &sp);704+ if ((long)((unsigned long)child + IA64_STK_OFFSET - sp)705+ < IA64_PT_REGS_SIZE) {706+ dprintk("ptrace.%s: ran off the top of the kernel "707+ "stack\n", __FUNCTION__);708 return;709+ }710+ if (unw_get_pr (&prev_info, &pr) < 0) {711+ unw_get_rp(&prev_info, &ip);712+ dprintk("ptrace.%s: failed to read "713+ "predicate register (ip=0x%lx)\n",714+ __FUNCTION__, ip);715+ return;716+ }717+ if (unw_is_intr_frame(&info)718+ && (pr & (1UL << PRED_USER_STACK)))719 break;720 }721
···182 }183 }184185- /*186- * A zero mmap always succeeds in Linux, independent of whether or not the187- * remaining arguments are valid.188- */189- if (len == 0)190- goto out;191-192 /* Careful about overflows.. */193 len = PAGE_ALIGN(len);194 if (!len || len > TASK_SIZE) {
···182 }183 }1840000000185 /* Careful about overflows.. */186 len = PAGE_ALIGN(len);187 if (!len || len > TASK_SIZE) {
+2
arch/ia64/sn/kernel/setup.c
···271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();272 extern void sn_cpu_init(void);27300274 /*275 * If the generic code has enabled vga console support - lets276 * get rid of it again. This is a kludge for the fact that ACPI
···271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();272 extern void sn_cpu_init(void);273274+ ia64_sn_plat_set_error_handling_features();275+276 /*277 * If the generic code has enabled vga console support - lets278 * get rid of it again. This is a kludge for the fact that ACPI
+2-2
arch/ppc/Kconfig
···11431144config PCI_82601145 bool1146- depends on PCI && 8260 && !82721147 default y11481149config 8260_PCI91150 bool " Enable workaround for MPC826x erratum PCI 9"1151- depends on PCI_82601152 default y11531154choice
···11431144config PCI_82601145 bool1146+ depends on PCI && 82601147 default y11481149config 8260_PCI91150 bool " Enable workaround for MPC826x erratum PCI 9"1151+ depends on PCI_8260 && !ADS82721152 default y11531154choice
+2-1
arch/ppc/boot/images/Makefile
···22$(obj)/uImage: $(obj)/vmlinux.gz23 $(Q)rm -f $@24 $(call if_changed,uimage)25- @echo ' Image: $@' $(if $(wildcard $@),'is ready','not made')02627# Files generated that shall be removed upon make clean28clean-files := sImage vmapus vmlinux* miboot* zImage* uImage
···22$(obj)/uImage: $(obj)/vmlinux.gz23 $(Q)rm -f $@24 $(call if_changed,uimage)25+ @echo -n ' Image: $@ '26+ @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi2728# Files generated that shall be removed upon make clean29clean-files := sImage vmapus vmlinux* miboot* zImage* uImage
+92-25
arch/ppc/configs/mpc8555_cds_defconfig
···1#2# Automatically generated make config: don't edit3-# Linux kernel version: 2.6.11-rc14-# Thu Jan 20 01:25:35 20055#6CONFIG_MMU=y7CONFIG_GENERIC_HARDIRQS=y···11CONFIG_PPC=y12CONFIG_PPC32=y13CONFIG_GENERIC_NVRAM=y01415#16# Code maturity level options···19CONFIG_EXPERIMENTAL=y20CONFIG_CLEAN_COMPILE=y21CONFIG_BROKEN_ON_SMP=y02223#24# General setup···31# CONFIG_BSD_PROCESS_ACCT is not set32CONFIG_SYSCTL=y33# CONFIG_AUDIT is not set34-CONFIG_LOG_BUF_SHIFT=1435# CONFIG_HOTPLUG is not set36CONFIG_KOBJECT_UEVENT=y37# CONFIG_IKCONFIG is not set38CONFIG_EMBEDDED=y39# CONFIG_KALLSYMS is not set00040CONFIG_FUTEX=y41# CONFIG_EPOLL is not set42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set···48CONFIG_CC_ALIGN_LOOPS=049CONFIG_CC_ALIGN_JUMPS=050# CONFIG_TINY_SHMEM is not set05152#53# Loadable module support···67CONFIG_E500=y68CONFIG_BOOKE=y69CONFIG_FSL_BOOKE=y070CONFIG_SPE=y71CONFIG_MATH_EMULATION=y72# CONFIG_CPU_FREQ is not set73CONFIG_PPC_GEN550=y074CONFIG_85xx=y75CONFIG_PPC_INDIRECT_PCI_BE=y76···83CONFIG_MPC8555_CDS=y84# CONFIG_MPC8560_ADS is not set85# CONFIG_SBC8560 is not set086CONFIG_MPC8555=y87CONFIG_85xx_PCI2=y88···98CONFIG_BINFMT_ELF=y99# CONFIG_BINFMT_MISC is not set100# CONFIG_CMDLINE_BOOL is not set0101102#103# Bus options···112# PCCARD (PCMCIA/CardBus) support113#114# CONFIG_PCCARD is not set115-116-#117-# PC-card bridges118-#119120#121# Advanced setup···185#186# ATA/ATAPI/MFM/RLL support187#188-# CONFIG_IDE is not set0000000000000000000000000000000000000000000000000000189190#191# SCSI device support···277#278CONFIG_PACKET=y279# CONFIG_PACKET_MMAP is not set280-# CONFIG_NETLINK_DEV is not set281CONFIG_UNIX=y282# CONFIG_NET_KEY is not set283CONFIG_INET=y···426# CONFIG_INPUT_EVBUG is not set427428#429-# Input I/O drivers430-#431-# CONFIG_GAMEPORT is not set432-CONFIG_SOUND_GAMEPORT=y433-# CONFIG_SERIO is not set434-# CONFIG_SERIO_I8042 is not set435-436-#437# Input Device Drivers438#439# CONFIG_INPUT_KEYBOARD is not set···433# CONFIG_INPUT_JOYSTICK is not set434# CONFIG_INPUT_TOUCHSCREEN is not set435# CONFIG_INPUT_MISC is not set0000000436437#438# Character devices···461CONFIG_SERIAL_CORE=y462CONFIG_SERIAL_CORE_CONSOLE=y463# CONFIG_SERIAL_CPM is not set0464CONFIG_UNIX98_PTYS=y465CONFIG_LEGACY_PTYS=y466CONFIG_LEGACY_PTY_COUNT=256···490# CONFIG_RAW_DRIVER is not set491492#00000493# I2C support494#495CONFIG_I2C=y···517# CONFIG_I2C_AMD8111 is not set518# CONFIG_I2C_I801 is not set519# CONFIG_I2C_I810 is not set0520# CONFIG_I2C_ISA is not set521CONFIG_I2C_MPC=y522# CONFIG_I2C_NFORCE2 is not set523# CONFIG_I2C_PARPORT_LIGHT is not set524-# CONFIG_I2C_PIIX4 is not set525# CONFIG_I2C_PROSAVAGE is not set526# CONFIG_I2C_SAVAGE4 is not set527# CONFIG_SCx200_ACB is not set···544# CONFIG_SENSORS_ASB100 is not set545# CONFIG_SENSORS_DS1621 is not set546# CONFIG_SENSORS_FSCHER is not set0547# CONFIG_SENSORS_GL518SM is not set0548# CONFIG_SENSORS_IT87 is not set549# CONFIG_SENSORS_LM63 is not set550# CONFIG_SENSORS_LM75 is not set···557# CONFIG_SENSORS_LM85 is not set558# CONFIG_SENSORS_LM87 is not set559# CONFIG_SENSORS_LM90 is not set0560# CONFIG_SENSORS_MAX1619 is not set561# CONFIG_SENSORS_PC87360 is not set562# CONFIG_SENSORS_SMSC47B397 is not set0563# CONFIG_SENSORS_SMSC47M1 is not set564# CONFIG_SENSORS_VIA686A is not set565# CONFIG_SENSORS_W83781D is not set···571#572# Other I2C Chip support573#0574# CONFIG_SENSORS_EEPROM is not set575# CONFIG_SENSORS_PCF8574 is not set576# CONFIG_SENSORS_PCF8591 is not set577# CONFIG_SENSORS_RTC8564 is not set0578# CONFIG_I2C_DEBUG_CORE is not set579# CONFIG_I2C_DEBUG_ALGO is not set580# CONFIG_I2C_DEBUG_BUS is not set···605# Graphics support606#607# CONFIG_FB is not set608-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set609610#611# Sound···614#615# USB support616#617-# CONFIG_USB is not set618CONFIG_USB_ARCH_HAS_HCD=y619CONFIG_USB_ARCH_HAS_OHCI=y620-621-#622-# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information623-#624625#626# USB Gadget Support···647CONFIG_FS_MBCACHE=y648# CONFIG_REISERFS_FS is not set649# CONFIG_JFS_FS is not set0000650# CONFIG_XFS_FS is not set651# CONFIG_MINIX_FS is not set652# CONFIG_ROMFS_FS is not set···712# CONFIG_NFSD is not set713CONFIG_ROOT_NFS=y714CONFIG_LOCKD=y715-# CONFIG_EXPORTFS is not set716CONFIG_SUNRPC=y717# CONFIG_RPCSEC_GSS_KRB5 is not set718# CONFIG_RPCSEC_GSS_SPKM3 is not set···763#764# Kernel hacking765#0766# CONFIG_DEBUG_KERNEL is not set0767# CONFIG_KGDB_CONSOLE is not set768# CONFIG_SERIAL_TEXT_DEBUG is not set769
···1#2# Automatically generated make config: don't edit3+# Linux kernel version: 2.6.12-rc44+# Tue May 17 11:56:01 20055#6CONFIG_MMU=y7CONFIG_GENERIC_HARDIRQS=y···11CONFIG_PPC=y12CONFIG_PPC32=y13CONFIG_GENERIC_NVRAM=y14+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y1516#17# Code maturity level options···18CONFIG_EXPERIMENTAL=y19CONFIG_CLEAN_COMPILE=y20CONFIG_BROKEN_ON_SMP=y21+CONFIG_INIT_ENV_ARG_LIMIT=322223#24# General setup···29# CONFIG_BSD_PROCESS_ACCT is not set30CONFIG_SYSCTL=y31# CONFIG_AUDIT is not set032# CONFIG_HOTPLUG is not set33CONFIG_KOBJECT_UEVENT=y34# CONFIG_IKCONFIG is not set35CONFIG_EMBEDDED=y36# CONFIG_KALLSYMS is not set37+CONFIG_PRINTK=y38+CONFIG_BUG=y39+CONFIG_BASE_FULL=y40CONFIG_FUTEX=y41# CONFIG_EPOLL is not set42# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set···44CONFIG_CC_ALIGN_LOOPS=045CONFIG_CC_ALIGN_JUMPS=046# CONFIG_TINY_SHMEM is not set47+CONFIG_BASE_SMALL=04849#50# Loadable module support···62CONFIG_E500=y63CONFIG_BOOKE=y64CONFIG_FSL_BOOKE=y65+# CONFIG_PHYS_64BIT is not set66CONFIG_SPE=y67CONFIG_MATH_EMULATION=y68# CONFIG_CPU_FREQ is not set69CONFIG_PPC_GEN550=y70+# CONFIG_PM is not set71CONFIG_85xx=y72CONFIG_PPC_INDIRECT_PCI_BE=y73···76CONFIG_MPC8555_CDS=y77# CONFIG_MPC8560_ADS is not set78# CONFIG_SBC8560 is not set79+# CONFIG_STX_GP3 is not set80CONFIG_MPC8555=y81CONFIG_85xx_PCI2=y82···90CONFIG_BINFMT_ELF=y91# CONFIG_BINFMT_MISC is not set92# CONFIG_CMDLINE_BOOL is not set93+CONFIG_ISA_DMA_API=y9495#96# Bus options···103# PCCARD (PCMCIA/CardBus) support104#105# CONFIG_PCCARD is not set0000106107#108# Advanced setup···180#181# ATA/ATAPI/MFM/RLL support182#183+CONFIG_IDE=y184+CONFIG_BLK_DEV_IDE=y185+186+#187+# Please see Documentation/ide.txt for help/info on IDE drives188+#189+# CONFIG_BLK_DEV_IDE_SATA is not set190+CONFIG_BLK_DEV_IDEDISK=y191+# CONFIG_IDEDISK_MULTI_MODE is not set192+# CONFIG_BLK_DEV_IDECD is not set193+# CONFIG_BLK_DEV_IDETAPE is not set194+# CONFIG_BLK_DEV_IDEFLOPPY is not set195+# CONFIG_IDE_TASK_IOCTL is not set196+197+#198+# IDE chipset support/bugfixes199+#200+CONFIG_IDE_GENERIC=y201+CONFIG_BLK_DEV_IDEPCI=y202+CONFIG_IDEPCI_SHARE_IRQ=y203+# CONFIG_BLK_DEV_OFFBOARD is not set204+CONFIG_BLK_DEV_GENERIC=y205+# CONFIG_BLK_DEV_OPTI621 is not set206+# CONFIG_BLK_DEV_SL82C105 is not set207+CONFIG_BLK_DEV_IDEDMA_PCI=y208+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set209+CONFIG_IDEDMA_PCI_AUTO=y210+# CONFIG_IDEDMA_ONLYDISK is not set211+# CONFIG_BLK_DEV_AEC62XX is not set212+# CONFIG_BLK_DEV_ALI15X3 is not set213+# CONFIG_BLK_DEV_AMD74XX is not set214+# CONFIG_BLK_DEV_CMD64X is not set215+# CONFIG_BLK_DEV_TRIFLEX is not set216+# CONFIG_BLK_DEV_CY82C693 is not set217+# CONFIG_BLK_DEV_CS5520 is not set218+# CONFIG_BLK_DEV_CS5530 is not set219+# CONFIG_BLK_DEV_HPT34X is not set220+# CONFIG_BLK_DEV_HPT366 is not set221+# CONFIG_BLK_DEV_SC1200 is not set222+# CONFIG_BLK_DEV_PIIX is not set223+# CONFIG_BLK_DEV_NS87415 is not set224+# CONFIG_BLK_DEV_PDC202XX_OLD is not set225+# CONFIG_BLK_DEV_PDC202XX_NEW is not set226+# CONFIG_BLK_DEV_SVWKS is not set227+# CONFIG_BLK_DEV_SIIMAGE is not set228+# CONFIG_BLK_DEV_SLC90E66 is not set229+# CONFIG_BLK_DEV_TRM290 is not set230+CONFIG_BLK_DEV_VIA82CXXX=y231+# CONFIG_IDE_ARM is not set232+CONFIG_BLK_DEV_IDEDMA=y233+# CONFIG_IDEDMA_IVB is not set234+CONFIG_IDEDMA_AUTO=y235+# CONFIG_BLK_DEV_HD is not set236237#238# SCSI device support···220#221CONFIG_PACKET=y222# CONFIG_PACKET_MMAP is not set0223CONFIG_UNIX=y224# CONFIG_NET_KEY is not set225CONFIG_INET=y···370# CONFIG_INPUT_EVBUG is not set371372#00000000373# Input Device Drivers374#375# CONFIG_INPUT_KEYBOARD is not set···385# CONFIG_INPUT_JOYSTICK is not set386# CONFIG_INPUT_TOUCHSCREEN is not set387# CONFIG_INPUT_MISC is not set388+389+#390+# Hardware I/O ports391+#392+# CONFIG_SERIO is not set393+# CONFIG_GAMEPORT is not set394+CONFIG_SOUND_GAMEPORT=y395396#397# Character devices···406CONFIG_SERIAL_CORE=y407CONFIG_SERIAL_CORE_CONSOLE=y408# CONFIG_SERIAL_CPM is not set409+# CONFIG_SERIAL_JSM is not set410CONFIG_UNIX98_PTYS=y411CONFIG_LEGACY_PTYS=y412CONFIG_LEGACY_PTY_COUNT=256···434# CONFIG_RAW_DRIVER is not set435436#437+# TPM devices438+#439+# CONFIG_TCG_TPM is not set440+441+#442# I2C support443#444CONFIG_I2C=y···456# CONFIG_I2C_AMD8111 is not set457# CONFIG_I2C_I801 is not set458# CONFIG_I2C_I810 is not set459+# CONFIG_I2C_PIIX4 is not set460# CONFIG_I2C_ISA is not set461CONFIG_I2C_MPC=y462# CONFIG_I2C_NFORCE2 is not set463# CONFIG_I2C_PARPORT_LIGHT is not set0464# CONFIG_I2C_PROSAVAGE is not set465# CONFIG_I2C_SAVAGE4 is not set466# CONFIG_SCx200_ACB is not set···483# CONFIG_SENSORS_ASB100 is not set484# CONFIG_SENSORS_DS1621 is not set485# CONFIG_SENSORS_FSCHER is not set486+# CONFIG_SENSORS_FSCPOS is not set487# CONFIG_SENSORS_GL518SM is not set488+# CONFIG_SENSORS_GL520SM is not set489# CONFIG_SENSORS_IT87 is not set490# CONFIG_SENSORS_LM63 is not set491# CONFIG_SENSORS_LM75 is not set···494# CONFIG_SENSORS_LM85 is not set495# CONFIG_SENSORS_LM87 is not set496# CONFIG_SENSORS_LM90 is not set497+# CONFIG_SENSORS_LM92 is not set498# CONFIG_SENSORS_MAX1619 is not set499# CONFIG_SENSORS_PC87360 is not set500# CONFIG_SENSORS_SMSC47B397 is not set501+# CONFIG_SENSORS_SIS5595 is not set502# CONFIG_SENSORS_SMSC47M1 is not set503# CONFIG_SENSORS_VIA686A is not set504# CONFIG_SENSORS_W83781D is not set···506#507# Other I2C Chip support508#509+# CONFIG_SENSORS_DS1337 is not set510# CONFIG_SENSORS_EEPROM is not set511# CONFIG_SENSORS_PCF8574 is not set512# CONFIG_SENSORS_PCF8591 is not set513# CONFIG_SENSORS_RTC8564 is not set514+# CONFIG_SENSORS_M41T00 is not set515# CONFIG_I2C_DEBUG_CORE is not set516# CONFIG_I2C_DEBUG_ALGO is not set517# CONFIG_I2C_DEBUG_BUS is not set···538# Graphics support539#540# CONFIG_FB is not set0541542#543# Sound···548#549# USB support550#0551CONFIG_USB_ARCH_HAS_HCD=y552CONFIG_USB_ARCH_HAS_OHCI=y553+# CONFIG_USB is not set000554555#556# USB Gadget Support···585CONFIG_FS_MBCACHE=y586# CONFIG_REISERFS_FS is not set587# CONFIG_JFS_FS is not set588+589+#590+# XFS support591+#592# CONFIG_XFS_FS is not set593# CONFIG_MINIX_FS is not set594# CONFIG_ROMFS_FS is not set···646# CONFIG_NFSD is not set647CONFIG_ROOT_NFS=y648CONFIG_LOCKD=y0649CONFIG_SUNRPC=y650# CONFIG_RPCSEC_GSS_KRB5 is not set651# CONFIG_RPCSEC_GSS_SPKM3 is not set···698#699# Kernel hacking700#701+# CONFIG_PRINTK_TIME is not set702# CONFIG_DEBUG_KERNEL is not set703+CONFIG_LOG_BUF_SHIFT=14704# CONFIG_KGDB_CONSOLE is not set705# CONFIG_SERIAL_TEXT_DEBUG is not set706
···232 tlbwe233234/* 7. Jump to KERNELBASE mapping */235+ lis r7,MSR_KERNEL@h236+ ori r7,r7,MSR_KERNEL@l237 bl 1f /* Find our address */2381: mflr r9239 rlwimi r6,r9,0,20,31···291 mfspr r2,SPRN_HID0292 oris r2,r2,HID0_DOZE@h293 mtspr SPRN_HID0, r2294+#endif295+296+#if !defined(CONFIG_BDI_SWITCH)297+ /*298+ * The Abatron BDI JTAG debugger does not tolerate others299+ * mucking with the debug registers.300+ */301+ lis r2,DBCR0_IDM@h302+ mtspr SPRN_DBCR0,r2303+ /* clear any residual debug events */304+ li r2,-1305+ mtspr SPRN_DBSR,r2306#endif307308 /*
+1-6
arch/ppc/kernel/traps.c
···408409 /* Early out if we are an invalid form of lswx */410 if ((instword & INST_STRING_MASK) == INST_LSWX)411- if ((rA >= rT) || (NB_RB >= rT) || (rT == rA) || (rT == NB_RB))412- return -EINVAL;413-414- /* Early out if we are an invalid form of lswi */415- if ((instword & INST_STRING_MASK) == INST_LSWI)416- if ((rA >= rT) || (rT == rA))417 return -EINVAL;418419 EA = (rA == 0) ? 0 : regs->gpr[rA];
···408409 /* Early out if we are an invalid form of lswx */410 if ((instword & INST_STRING_MASK) == INST_LSWX)411+ if ((rT == rA) || (rT == NB_RB))00000412 return -EINVAL;413414 EA = (rA == 0) ? 0 : regs->gpr[rA];
-1
arch/ppc/platforms/83xx/mpc834x_sys.c
···127{128 /* we steal the lowest ioremap addr for virt space */129 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO);130- io_block_mapping(BCSR_VIRT_ADDR, BCSR_PHYS_ADDR, BCSR_SIZE, _PAGE_IO);131}132133int
···127{128 /* we steal the lowest ioremap addr for virt space */129 io_block_mapping(VIRT_IMMRBAR, immrbar, 1024*1024, _PAGE_IO);0130}131132int
···1-/*2- * (C) Copyright 20033- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.4- *5- * (C) Copyright 2004 Red Hat, Inc.6- *7- * See file CREDITS for list of people who contributed to this8- * project.9- *10- * This program is free software; you can redistribute it and/or11- * modify it under the terms of the GNU General Public License as12- * published by the Free Software Foundation; either version 2 of13- * the License, or (at your option) any later version.14- *15- * This program is distributed in the hope that it will be useful,16- * but WITHOUT ANY WARRANTY; without even the implied warranty of17- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the18- * GNU General Public License for more details.19- *20- * You should have received a copy of the GNU General Public License21- * along with this program; if not, write to the Free Software22- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,23- * MA 02111-1307 USA24- */25-26-#include <linux/kernel.h>27-#include <linux/init.h>28-#include <linux/pci.h>29-#include <linux/slab.h>30-#include <linux/delay.h>31-32-#include <asm/byteorder.h>33-#include <asm/io.h>34-#include <asm/irq.h>35-#include <asm/uaccess.h>36-#include <asm/machdep.h>37-#include <asm/pci-bridge.h>38-#include <asm/immap_cpm2.h>39-#include <asm/mpc8260.h>40-41-#include "m8260_pci.h"42-43-44-/* PCI bus configuration registers.45- */46-47-static void __init m8260_setup_pci(struct pci_controller *hose)48-{49- volatile cpm2_map_t *immap = cpm2_immr;50- unsigned long pocmr;51- u16 tempShort;52-53-#ifndef CONFIG_ATC /* already done in U-Boot */54- /* 55- * Setting required to enable IRQ1-IRQ7 (SIUMCR [DPPC]), 56- * and local bus for PCI (SIUMCR [LBPC]).57- */58- immap->im_siu_conf.siu_82xx.sc_siumcr = 0x00640000;59-#endif60-61- /* Make PCI lowest priority */62- /* Each 4 bits is a device bus request and the MS 4bits 63- is highest priority */64- /* Bus 4bit value 65- --- ----------66- CPM high 0b000067- CPM middle 0b000168- CPM low 0b001069- PCI reguest 0b001170- Reserved 0b010071- Reserved 0b010172- Internal Core 0b011073- External Master 1 0b011174- External Master 2 0b100075- External Master 3 0b100176- The rest are reserved */77- immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x61207893;78-79- /* Park bus on core while modifying PCI Bus accesses */80- immap->im_siu_conf.siu_82xx.sc_ppc_acr = 0x6;81-82- /* 83- * Set up master window that allows the CPU to access PCI space. This 84- * window is set up using the first SIU PCIBR registers.85- */86- immap->im_memctl.memc_pcimsk0 = MPC826x_PCI_MASK;87- immap->im_memctl.memc_pcibr0 = MPC826x_PCI_BASE | PCIBR_ENABLE;88-89- /* Disable machine check on no response or target abort */90- immap->im_pci.pci_emr = cpu_to_le32(0x1fe7);91- /* Release PCI RST (by default the PCI RST signal is held low) */92- immap->im_pci.pci_gcr = cpu_to_le32(PCIGCR_PCI_BUS_EN);93-94- /* give it some time */95- mdelay(1);96-97- /* 98- * Set up master window that allows the CPU to access PCI Memory (prefetch) 99- * space. This window is set up using the first set of Outbound ATU registers.100- */101- immap->im_pci.pci_potar0 = cpu_to_le32(MPC826x_PCI_LOWER_MEM >> 12);102- immap->im_pci.pci_pobar0 = cpu_to_le32((MPC826x_PCI_LOWER_MEM - MPC826x_PCI_MEM_OFFSET) >> 12);103- pocmr = ((MPC826x_PCI_UPPER_MEM - MPC826x_PCI_LOWER_MEM) >> 12) ^ 0xfffff;104- immap->im_pci.pci_pocmr0 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PREFETCH_EN);105-106- /* 107- * Set up master window that allows the CPU to access PCI Memory (non-prefetch) 108- * space. This window is set up using the second set of Outbound ATU registers.109- */110- immap->im_pci.pci_potar1 = cpu_to_le32(MPC826x_PCI_LOWER_MMIO >> 12);111- immap->im_pci.pci_pobar1 = cpu_to_le32((MPC826x_PCI_LOWER_MMIO - MPC826x_PCI_MMIO_OFFSET) >> 12);112- pocmr = ((MPC826x_PCI_UPPER_MMIO - MPC826x_PCI_LOWER_MMIO) >> 12) ^ 0xfffff;113- immap->im_pci.pci_pocmr1 = cpu_to_le32(pocmr | POCMR_ENABLE);114-115- /* 116- * Set up master window that allows the CPU to access PCI IO space. This window117- * is set up using the third set of Outbound ATU registers.118- */119- immap->im_pci.pci_potar2 = cpu_to_le32(MPC826x_PCI_IO_BASE >> 12);120- immap->im_pci.pci_pobar2 = cpu_to_le32(MPC826x_PCI_LOWER_IO >> 12);121- pocmr = ((MPC826x_PCI_UPPER_IO - MPC826x_PCI_LOWER_IO) >> 12) ^ 0xfffff;122- immap->im_pci.pci_pocmr2 = cpu_to_le32(pocmr | POCMR_ENABLE | POCMR_PCI_IO);123-124- /* 125- * Set up slave window that allows PCI masters to access MPC826x local memory. 126- * This window is set up using the first set of Inbound ATU registers127- */128-129- immap->im_pci.pci_pitar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_LOCAL >> 12);130- immap->im_pci.pci_pibar0 = cpu_to_le32(MPC826x_PCI_SLAVE_MEM_BUS >> 12);131- pocmr = ((MPC826x_PCI_SLAVE_MEM_SIZE-1) >> 12) ^ 0xfffff;132- immap->im_pci.pci_picmr0 = cpu_to_le32(pocmr | PICMR_ENABLE | PICMR_PREFETCH_EN);133-134- /* See above for description - puts PCI request as highest priority */135- immap->im_siu_conf.siu_82xx.sc_ppc_alrh = 0x03124567;136-137- /* Park the bus on the PCI */138- immap->im_siu_conf.siu_82xx.sc_ppc_acr = PPC_ACR_BUS_PARK_PCI;139-140- /* Host mode - specify the bridge as a host-PCI bridge */141- early_write_config_word(hose, 0, 0, PCI_CLASS_DEVICE, PCI_CLASS_BRIDGE_HOST);142-143- /* Enable the host bridge to be a master on the PCI bus, and to act as a PCI memory target */144- early_read_config_word(hose, 0, 0, PCI_COMMAND, &tempShort);145- early_write_config_word(hose, 0, 0, PCI_COMMAND,146- tempShort | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY);147-}148-149-void __init m8260_find_bridges(void)150-{151- extern int pci_assign_all_busses;152- struct pci_controller * hose;153-154- pci_assign_all_busses = 1;155-156- hose = pcibios_alloc_controller();157-158- if (!hose)159- return;160-161- ppc_md.pci_swizzle = common_swizzle;162-163- hose->first_busno = 0;164- hose->bus_offset = 0;165- hose->last_busno = 0xff;166-167- setup_m8260_indirect_pci(hose, 168- (unsigned long)&cpm2_immr->im_pci.pci_cfg_addr,169- (unsigned long)&cpm2_immr->im_pci.pci_cfg_data);170-171- m8260_setup_pci(hose);172- hose->pci_mem_offset = MPC826x_PCI_MEM_OFFSET;173-174- hose->io_base_virt = ioremap(MPC826x_PCI_IO_BASE,175- MPC826x_PCI_IO_SIZE);176- isa_io_base = (unsigned long) hose->io_base_virt;177-178- /* setup resources */179- pci_init_resource(&hose->mem_resources[0],180- MPC826x_PCI_LOWER_MEM,181- MPC826x_PCI_UPPER_MEM,182- IORESOURCE_MEM|IORESOURCE_PREFETCH, "PCI prefetchable memory");183-184- pci_init_resource(&hose->mem_resources[1],185- MPC826x_PCI_LOWER_MMIO,186- MPC826x_PCI_UPPER_MMIO,187- IORESOURCE_MEM, "PCI memory");188-189- pci_init_resource(&hose->io_resource,190- MPC826x_PCI_LOWER_IO,191- MPC826x_PCI_UPPER_IO,192- IORESOURCE_IO, "PCI I/O");193-}
···31#include <asm/immap_cpm2.h>32#include <asm/cpm2.h>3334-#include "m8260_pci.h"3536#ifdef CONFIG_8260_PCI937/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */···248249static inline int is_pci_mem(unsigned long addr)250{251- if (addr >= MPC826x_PCI_LOWER_MMIO &&252- addr <= MPC826x_PCI_UPPER_MMIO)253 return 1;254- if (addr >= MPC826x_PCI_LOWER_MEM &&255- addr <= MPC826x_PCI_UPPER_MEM)256 return 1;257 return 0;258}
···31#include <asm/immap_cpm2.h>32#include <asm/cpm2.h>3334+#include "m82xx_pci.h"3536#ifdef CONFIG_8260_PCI937/*#include <asm/mpc8260_pci9.h>*/ /* included in asm/io.h */···248249static inline int is_pci_mem(unsigned long addr)250{251+ if (addr >= M82xx_PCI_LOWER_MMIO &&252+ addr <= M82xx_PCI_UPPER_MMIO)253 return 1;254+ if (addr >= M82xx_PCI_LOWER_MEM &&255+ addr <= M82xx_PCI_UPPER_MEM)256 return 1;257 return 0;258}
+9-2
arch/ppc/syslib/m8260_setup.c
···34unsigned char __res[sizeof(bd_t)];3536extern void cpm2_reset(void);37-extern void m8260_find_bridges(void);038extern void idma_pci9_init(void);3940/* Place-holder for board-specific init */···57 idma_pci9_init();58#endif59#ifdef CONFIG_PCI_826060- m8260_find_bridges();61#endif62#ifdef CONFIG_BLK_DEV_INITRD63 if (initrd_start)···174 * in case the boot rom changed something on us.175 */176 cpm2_immr->im_intctl.ic_siprr = 0x05309770;000000177}178179/*
···34unsigned char __res[sizeof(bd_t)];3536extern void cpm2_reset(void);37+extern void pq2_find_bridges(void);38+extern void pq2pci_init_irq(void);39extern void idma_pci9_init(void);4041/* Place-holder for board-specific init */···56 idma_pci9_init();57#endif58#ifdef CONFIG_PCI_826059+ pq2_find_bridges();60#endif61#ifdef CONFIG_BLK_DEV_INITRD62 if (initrd_start)···173 * in case the boot rom changed something on us.174 */175 cpm2_immr->im_intctl.ic_siprr = 0x05309770;176+177+#if defined(CONFIG_PCI) && (defined(CONFIG_ADS8272) || defined(CONFIG_PQ2FADS))178+ /* Initialize stuff for the 82xx CPLD IC and install demux */179+ pq2pci_init_irq();180+#endif181+182}183184/*
···1+2+#ifndef _PPC_KERNEL_M82XX_PCI_H3+#define _PPC_KERNEL_M82XX_PCI_H4+5+#include <asm/m8260_pci.h>6+/*7+ * Local->PCI map (from CPU) controlled by8+ * MPC826x master window9+ *10+ * 0xF6000000 - 0xF7FFFFFF IO space11+ * 0x80000000 - 0xBFFFFFFF CPU2PCI memory space PCIBR012+ *13+ * 0x80000000 - 0x9FFFFFFF PCI Mem with prefetch (Outbound ATU #1)14+ * 0xA0000000 - 0xBFFFFFFF PCI Mem w/o prefetch (Outbound ATU #2)15+ * 0xF6000000 - 0xF7FFFFFF 32-bit PCI IO (Outbound ATU #3)16+ *17+ * PCI->Local map (from PCI)18+ * MPC826x slave window controlled by19+ *20+ * 0x00000000 - 0x07FFFFFF MPC826x local memory (Inbound ATU #1)21+ */22+23+/*24+ * Slave window that allows PCI masters to access MPC826x local memory.25+ * This window is set up using the first set of Inbound ATU registers26+ */27+28+#ifndef M82xx_PCI_SLAVE_MEM_LOCAL29+#define M82xx_PCI_SLAVE_MEM_LOCAL (((struct bd_info *)__res)->bi_memstart)30+#define M82xx_PCI_SLAVE_MEM_BUS (((struct bd_info *)__res)->bi_memstart)31+#define M82xx_PCI_SLAVE_MEM_SIZE (((struct bd_info *)__res)->bi_memsize)32+#endif33+34+/*35+ * This is the window that allows the CPU to access PCI address space.36+ * It will be setup with the SIU PCIBR0 register. All three PCI master37+ * windows, which allow the CPU to access PCI prefetch, non prefetch,38+ * and IO space (see below), must all fit within this window.39+ */40+41+#ifndef M82xx_PCI_LOWER_MEM42+#define M82xx_PCI_LOWER_MEM 0x8000000043+#define M82xx_PCI_UPPER_MEM 0x9fffffff44+#define M82xx_PCI_MEM_OFFSET 0x0000000045+#define M82xx_PCI_MEM_SIZE 0x2000000046+#endif47+48+#ifndef M82xx_PCI_LOWER_MMIO49+#define M82xx_PCI_LOWER_MMIO 0xa000000050+#define M82xx_PCI_UPPER_MMIO 0xafffffff51+#define M82xx_PCI_MMIO_OFFSET 0x0000000052+#define M82xx_PCI_MMIO_SIZE 0x2000000053+#endif54+55+#ifndef M82xx_PCI_LOWER_IO56+#define M82xx_PCI_LOWER_IO 0x0000000057+#define M82xx_PCI_UPPER_IO 0x01ffffff58+#define M82xx_PCI_IO_BASE 0xf600000059+#define M82xx_PCI_IO_SIZE 0x0200000060+#endif61+62+#ifndef M82xx_PCI_PRIM_WND_SIZE63+#define M82xx_PCI_PRIM_WND_SIZE ~(M82xx_PCI_IO_SIZE - 1U)64+#define M82xx_PCI_PRIM_WND_BASE (M82xx_PCI_IO_BASE)65+#endif66+67+#ifndef M82xx_PCI_SEC_WND_SIZE68+#define M82xx_PCI_SEC_WND_SIZE ~(M82xx_PCI_MEM_SIZE + M82xx_PCI_MMIO_SIZE - 1U)69+#define M82xx_PCI_SEC_WND_BASE (M82xx_PCI_LOWER_MEM)70+#endif71+72+#ifndef POTA_ADDR_SHIFT73+#define POTA_ADDR_SHIFT 1274+#endif75+76+#ifndef PITA_ADDR_SHIFT77+#define PITA_ADDR_SHIFT 1278+#endif79+80+#ifndef _IO_BASE81+#define _IO_BASE isa_io_base82+#endif83+84+#ifdef CONFIG_8260_PCI985+struct pci_controller;86+extern void setup_m8260_indirect_pci(struct pci_controller* hose,87+ u32 cfg_addr, u32 cfg_data);88+#else89+#define setup_m8260_indirect_pci setup_indirect_pci90+#endif91+92+#endif /* _PPC_KERNEL_M8260_PCI_H */
+1-3
arch/ppc/syslib/open_pic.c
···275}276#endif277278-#if defined(CONFIG_EPIC_SERIAL_MODE) || defined(CONFIG_PM)279static void openpic_reset(void)280{281 openpic_setfield(&OpenPIC->Global.Global_Configuration0,···992 spin_unlock_irqrestore(&openpic_setup_lock, flags);993 return 0;994 }995-996- openpic_reset();997998 /* OpenPIC sometimes seem to need some time to be fully back up... */999 do {
···275}276#endif277278+#if defined(CONFIG_EPIC_SERIAL_MODE)279static void openpic_reset(void)280{281 openpic_setfield(&OpenPIC->Global.Global_Configuration0,···992 spin_unlock_irqrestore(&openpic_setup_lock, flags);993 return 0;994 }00995996 /* OpenPIC sometimes seem to need some time to be fully back up... */997 do {
···626 l = call_prom("package-to-path", 3, 1, node,627 mem_start, mem_end - mem_start);628 if (l >= 0) {629+ char *p, *ep;630+631 np->full_name = PTRUNRELOC((char *) mem_start);632 *(char *)(mem_start + l) = 0;633+ /* Fixup an Apple bug where they have bogus \0 chars in the634+ * middle of the path in some properties635+ */636+ for (p = (char *)mem_start, ep = p + l; p < ep; p++)637+ if ((*p) == '\0') {638+ memmove(p, p+1, ep - p);639+ ep--;640+ }641 mem_start = ALIGNUL(mem_start + l + 1);642 }643
-8
arch/ppc64/kernel/pSeries_reconfig.c
···47 remove_proc_entry(pp->name, np->pde);48 pp = pp->next;49 }50-51- /* Assuming that symlinks have the same parent directory as52- * np->pde.53- */54- if (np->name_link)55- remove_proc_entry(np->name_link->name, parent->pde);56- if (np->addr_link)57- remove_proc_entry(np->addr_link->name, parent->pde);58 if (np->pde)59 remove_proc_entry(np->pde->name, parent->pde);60}
···211 */212#define ADDR(x) (u32) ((unsigned long)(x) - offset)213000000000000214/* This is the one and *ONLY* place where we actually call open215 * firmware from, since we need to make sure we're running in 32b216 * mode when we do. We switch back to 64b mode upon return.217 */218-219-#define PROM_ERROR (-1)220221static int __init call_prom(const char *service, int nargs, int nret, ...)222{···597{598 unsigned long offset = reloc_offset();599 ihandle elfloader;600- int ret;601602 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));603 if (elfloader == 0) {604 prom_printf("couldn't open /packages/elf-loader\n");605 return;606 }607- ret = call_prom("call-method", 3, 1, ADDR("process-elf-header"),608 elfloader, ADDR(&fake_elf));609 call_prom("close", 1, 0, elfloader);610}···655 base = _ALIGN_UP(base + 0x100000, align)) {656 prom_debug(" trying: 0x%x\n\r", base);657 addr = (unsigned long)prom_claim(base, size, 0);658- if ((int)addr != PROM_ERROR)659 break;660 addr = 0;661 if (align == 0)···717 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) {718 prom_debug(" trying: 0x%x\n\r", base);719 addr = (unsigned long)prom_claim(base, size, 0);720- if ((int)addr != PROM_ERROR)721 break;722 addr = 0;723 }···911{912 unsigned long offset = reloc_offset();913 struct prom_t *_prom = PTRRELOC(&prom);914- phandle prom_rtas, rtas_node;0915 u32 base, entry = 0;916 u32 size = 0;917918 prom_debug("prom_instantiate_rtas: start...\n");919920- prom_rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));921- prom_debug("prom_rtas: %x\n", prom_rtas);922- if (prom_rtas == (phandle) -1)923 return;924925- prom_getprop(prom_rtas, "rtas-size", &size, sizeof(size));926 if (size == 0)927 return;928···932 prom_printf("RTAS allocation failed !\n");933 return;934 }935- prom_printf("instantiating rtas at 0x%x", base);936937- rtas_node = call_prom("open", 1, 1, ADDR("/rtas"));938- prom_printf("...");00000939940 if (call_prom("call-method", 3, 2,941 ADDR("instantiate-rtas"),942- rtas_node, base) != PROM_ERROR) {943 entry = (long)_prom->args.rets[1];944 }945 if (entry == 0) {···954955 reserve_mem(base, size);956957- prom_setprop(prom_rtas, "linux,rtas-base", &base, sizeof(base));958- prom_setprop(prom_rtas, "linux,rtas-entry", &entry, sizeof(entry));959960 prom_debug("rtas base = 0x%x\n", base);961 prom_debug("rtas entry = 0x%x\n", entry);···10761077 prom_printf("opening PHB %s", path);1078 phb_node = call_prom("open", 1, 1, path);1079- if ( (long)phb_node <= 0)1080 prom_printf("... failed\n");1081 else1082 prom_printf("... done\n");···12931294 /* get a handle for the stdout device */1295 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));1296- if ((long)_prom->chosen <= 0)1297 prom_panic("cannot find chosen"); /* msg won't be printed :( */12981299 /* get device tree root */1300 _prom->root = call_prom("finddevice", 1, 1, ADDR("/"));1301- if ((long)_prom->root <= 0)1302 prom_panic("cannot find device tree root"); /* msg won't be printed :( */1303}1304···1370 }1371 /* Default to pSeries. We need to know if we are running LPAR */1372 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));1373- if (rtas != (phandle) -1) {1374- unsigned long x;1375- x = prom_getproplen(rtas, "ibm,hypertas-functions");1376 if (x != PROM_ERROR) {1377 prom_printf("Hypertas detected, assuming LPAR !\n");1378 return PLATFORM_PSERIES_LPAR;···1439 * leave some room at the end of the path for appending extra1440 * arguments1441 */1442- if (call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-10) < 0)01443 continue;1444 prom_printf("found display : %s, opening ... ", path);14451446 ih = call_prom("open", 1, 1, path);1447- if (ih == (ihandle)0 || ih == (ihandle)-1) {1448 prom_printf("failed\n");1449 continue;1450 }···1528 return 0;1529}15300000001531static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,1532 unsigned long *mem_end)1533{···1547 /* get and store all property names */1548 prev_name = RELOC("");1549 for (;;) {1550-1551- /* 32 is max len of name including nul. */1552- namep = make_room(mem_start, mem_end, 32, 1);1553- if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0) {001554 /* No more nodes: unwind alloc */1555 *mem_start = (unsigned long)namep;1556 break;···1577 }1578}15791580-/*1581- * The Open Firmware 1275 specification states properties must be 31 bytes or1582- * less, however not all firmwares obey this. Make it 64 bytes to be safe.1583- */1584-#define MAX_PROPERTY_NAME 641585-1586static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,1587 unsigned long *mem_end)1588{1589 int l, align;1590 phandle child;1591- char *namep, *prev_name, *sstart;1592 unsigned long soff;1593 unsigned char *valp;1594 unsigned long offset = reloc_offset();···1604 call_prom("package-to-path", 3, 1, node, namep, l);1605 }1606 namep[l] = '\0';000000001607 *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4);1608 }1609···1623 prev_name = RELOC("");1624 sstart = (char *)RELOC(dt_string_start);1625 for (;;) {1626- if (call_prom("nextprop", 3, 1, node, prev_name, pname) <= 0)0001627 break;16281629 /* find string offset */···1642 l = call_prom("getproplen", 2, 1, node, pname);16431644 /* sanity checks */1645- if (l < 0)1646 continue;1647 if (l > MAX_PROPERTY_LENGTH) {1648 prom_printf("WARNING: ignoring large property ");···17901791 /* Some G5s have a missing interrupt definition, fix it up here */1792 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));1793- if ((long)u3 <= 0)1794 return;1795 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));1796- if ((long)i2c <= 0)1797 return;1798 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));1799- if ((long)mpic <= 0)1800 return;18011802 /* check if proper rev of u3 */1803- if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev)) <= 0)01804 return;1805 if (u3_rev != 0x35)1806 return;···1907 getprop_rval = RELOC(of_platform);1908 prom_setprop(_prom->chosen, "linux,platform",1909 &getprop_rval, sizeof(getprop_rval));00000019101911 /*1912 * On pSeries, copy the CPU hold code
···211 */212#define ADDR(x) (u32) ((unsigned long)(x) - offset)213214+/*215+ * Error results ... some OF calls will return "-1" on error, some216+ * will return 0, some will return either. To simplify, here are217+ * macros to use with any ihandle or phandle return value to check if218+ * it is valid219+ */220+221+#define PROM_ERROR (-1u)222+#define PHANDLE_VALID(p) ((p) != 0 && (p) != PROM_ERROR)223+#define IHANDLE_VALID(i) ((i) != 0 && (i) != PROM_ERROR)224+225+226/* This is the one and *ONLY* place where we actually call open227 * firmware from, since we need to make sure we're running in 32b228 * mode when we do. We switch back to 64b mode upon return.229 */00230231static int __init call_prom(const char *service, int nargs, int nret, ...)232{···587{588 unsigned long offset = reloc_offset();589 ihandle elfloader;0590591 elfloader = call_prom("open", 1, 1, ADDR("/packages/elf-loader"));592 if (elfloader == 0) {593 prom_printf("couldn't open /packages/elf-loader\n");594 return;595 }596+ call_prom("call-method", 3, 1, ADDR("process-elf-header"),597 elfloader, ADDR(&fake_elf));598 call_prom("close", 1, 0, elfloader);599}···646 base = _ALIGN_UP(base + 0x100000, align)) {647 prom_debug(" trying: 0x%x\n\r", base);648 addr = (unsigned long)prom_claim(base, size, 0);649+ if (addr != PROM_ERROR)650 break;651 addr = 0;652 if (align == 0)···708 for(; base > RELOC(alloc_bottom); base = _ALIGN_DOWN(base - 0x100000, align)) {709 prom_debug(" trying: 0x%x\n\r", base);710 addr = (unsigned long)prom_claim(base, size, 0);711+ if (addr != PROM_ERROR)712 break;713 addr = 0;714 }···902{903 unsigned long offset = reloc_offset();904 struct prom_t *_prom = PTRRELOC(&prom);905+ phandle rtas_node;906+ ihandle rtas_inst;907 u32 base, entry = 0;908 u32 size = 0;909910 prom_debug("prom_instantiate_rtas: start...\n");911912+ rtas_node = call_prom("finddevice", 1, 1, ADDR("/rtas"));913+ prom_debug("rtas_node: %x\n", rtas_node);914+ if (!PHANDLE_VALID(rtas_node))915 return;916917+ prom_getprop(rtas_node, "rtas-size", &size, sizeof(size));918 if (size == 0)919 return;920···922 prom_printf("RTAS allocation failed !\n");923 return;924 }0925926+ rtas_inst = call_prom("open", 1, 1, ADDR("/rtas"));927+ if (!IHANDLE_VALID(rtas_inst)) {928+ prom_printf("opening rtas package failed");929+ return;930+ }931+932+ prom_printf("instantiating rtas at 0x%x ...", base);933934 if (call_prom("call-method", 3, 2,935 ADDR("instantiate-rtas"),936+ rtas_inst, base) != PROM_ERROR) {937 entry = (long)_prom->args.rets[1];938 }939 if (entry == 0) {···940941 reserve_mem(base, size);942943+ prom_setprop(rtas_node, "linux,rtas-base", &base, sizeof(base));944+ prom_setprop(rtas_node, "linux,rtas-entry", &entry, sizeof(entry));945946 prom_debug("rtas base = 0x%x\n", base);947 prom_debug("rtas entry = 0x%x\n", entry);···10621063 prom_printf("opening PHB %s", path);1064 phb_node = call_prom("open", 1, 1, path);1065+ if (phb_node == 0)1066 prom_printf("... failed\n");1067 else1068 prom_printf("... done\n");···12791280 /* get a handle for the stdout device */1281 _prom->chosen = call_prom("finddevice", 1, 1, ADDR("/chosen"));1282+ if (!PHANDLE_VALID(_prom->chosen))1283 prom_panic("cannot find chosen"); /* msg won't be printed :( */12841285 /* get device tree root */1286 _prom->root = call_prom("finddevice", 1, 1, ADDR("/"));1287+ if (!PHANDLE_VALID(_prom->root))1288 prom_panic("cannot find device tree root"); /* msg won't be printed :( */1289}1290···1356 }1357 /* Default to pSeries. We need to know if we are running LPAR */1358 rtas = call_prom("finddevice", 1, 1, ADDR("/rtas"));1359+ if (!PHANDLE_VALID(rtas)) {1360+ int x = prom_getproplen(rtas, "ibm,hypertas-functions");01361 if (x != PROM_ERROR) {1362 prom_printf("Hypertas detected, assuming LPAR !\n");1363 return PLATFORM_PSERIES_LPAR;···1426 * leave some room at the end of the path for appending extra1427 * arguments1428 */1429+ if (call_prom("package-to-path", 3, 1, node, path,1430+ PROM_SCRATCH_SIZE-10) == PROM_ERROR)1431 continue;1432 prom_printf("found display : %s, opening ... ", path);14331434 ih = call_prom("open", 1, 1, path);1435+ if (ih == 0) {1436 prom_printf("failed\n");1437 continue;1438 }···1514 return 0;1515}15161517+/*1518+ * The Open Firmware 1275 specification states properties must be 31 bytes or1519+ * less, however not all firmwares obey this. Make it 64 bytes to be safe.1520+ */1521+#define MAX_PROPERTY_NAME 641522+1523static void __init scan_dt_build_strings(phandle node, unsigned long *mem_start,1524 unsigned long *mem_end)1525{···1527 /* get and store all property names */1528 prev_name = RELOC("");1529 for (;;) {1530+ int rc;1531+1532+ /* 64 is max len of name including nul. */1533+ namep = make_room(mem_start, mem_end, MAX_PROPERTY_NAME, 1);1534+ rc = call_prom("nextprop", 3, 1, node, prev_name, namep);1535+ if (rc != 1) {1536 /* No more nodes: unwind alloc */1537 *mem_start = (unsigned long)namep;1538 break;···1555 }1556}15570000001558static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,1559 unsigned long *mem_end)1560{1561 int l, align;1562 phandle child;1563+ char *namep, *prev_name, *sstart, *p, *ep;1564 unsigned long soff;1565 unsigned char *valp;1566 unsigned long offset = reloc_offset();···1588 call_prom("package-to-path", 3, 1, node, namep, l);1589 }1590 namep[l] = '\0';1591+ /* Fixup an Apple bug where they have bogus \0 chars in the1592+ * middle of the path in some properties1593+ */1594+ for (p = namep, ep = namep + l; p < ep; p++)1595+ if (*p == '\0') {1596+ memmove(p, p+1, ep - p);1597+ ep--; l--;1598+ }1599 *mem_start = _ALIGN(((unsigned long) namep) + strlen(namep) + 1, 4);1600 }1601···1599 prev_name = RELOC("");1600 sstart = (char *)RELOC(dt_string_start);1601 for (;;) {1602+ int rc;1603+1604+ rc = call_prom("nextprop", 3, 1, node, prev_name, pname);1605+ if (rc != 1)1606 break;16071608 /* find string offset */···1615 l = call_prom("getproplen", 2, 1, node, pname);16161617 /* sanity checks */1618+ if (l == PROM_ERROR)1619 continue;1620 if (l > MAX_PROPERTY_LENGTH) {1621 prom_printf("WARNING: ignoring large property ");···17631764 /* Some G5s have a missing interrupt definition, fix it up here */1765 u3 = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000"));1766+ if (!PHANDLE_VALID(u3))1767 return;1768 i2c = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/i2c@f8001000"));1769+ if (!PHANDLE_VALID(i2c))1770 return;1771 mpic = call_prom("finddevice", 1, 1, ADDR("/u3@0,f8000000/mpic@f8040000"));1772+ if (!PHANDLE_VALID(mpic))1773 return;17741775 /* check if proper rev of u3 */1776+ if (prom_getprop(u3, "device-rev", &u3_rev, sizeof(u3_rev))1777+ == PROM_ERROR)1778 return;1779 if (u3_rev != 0x35)1780 return;···1879 getprop_rval = RELOC(of_platform);1880 prom_setprop(_prom->chosen, "linux,platform",1881 &getprop_rval, sizeof(getprop_rval));1882+1883+ /*1884+ * On pSeries, inform the firmware about our capabilities1885+ */1886+ if (RELOC(of_platform) & PLATFORM_PSERIES)1887+ prom_send_capabilities();18881889 /*1890 * On pSeries, copy the CPU hold code
···1-/* Much of this ripped from hw_random.c */2-000003#include <linux/module.h>4#include <linux/fs.h>5#include <linux/miscdevice.h>···17 */18#define RNG_VERSION "1.0.0"19#define RNG_MODULE_NAME "random"20-#define RNG_DRIVER_NAME RNG_MODULE_NAME " virtual driver " RNG_VERSION21-#define PFX RNG_MODULE_NAME ": "2223#define RNG_MISCDEV_MINOR 183 /* official */24···101102 err = misc_register (&rng_miscdev);103 if (err) {104- printk (KERN_ERR PFX "misc device register failed\n");105 goto err_out_cleanup_hw;106 }107···123124module_init (rng_init);125module_exit (rng_cleanup);000
···1+/* Copyright (C) 2005 Jeff Dike <jdike@addtoit.com> */2+/* Much of this ripped from drivers/char/hw_random.c, see there for other3+ * copyright.4+ *5+ * This software may be used and distributed according to the terms6+ * of the GNU General Public License, incorporated herein by reference.7+ */8#include <linux/module.h>9#include <linux/fs.h>10#include <linux/miscdevice.h>···12 */13#define RNG_VERSION "1.0.0"14#define RNG_MODULE_NAME "random"001516#define RNG_MISCDEV_MINOR 183 /* official */17···9899 err = misc_register (&rng_miscdev);100 if (err) {101+ printk (KERN_ERR RNG_MODULE_NAME ": misc device register failed\n");102 goto err_out_cleanup_hw;103 }104···120121module_init (rng_init);122module_exit (rng_cleanup);123+124+MODULE_DESCRIPTION("UML Host Random Number Generator (RNG) driver");125+MODULE_LICENSE("GPL");
-1
arch/um/drivers/ssl.c
···22#include "init.h"23#include "irq_user.h"24#include "mconsole_kern.h"25-#include "2_5compat.h"2627static int ssl_version = 1;28
···22#include "init.h"23#include "irq_user.h"24#include "mconsole_kern.h"02526static int ssl_version = 1;27
···49#include "irq_user.h"50#include "irq_kern.h"51#include "ubd_user.h"52-#include "2_5compat.h"53#include "os.h"54#include "mem.h"55#include "mem_kern.h"···439__setup("udb", udb_setup);440__uml_help(udb_setup,441"udb\n"442-" This option is here solely to catch ubd -> udb typos, which can be\n\n"443-" to impossible to catch visually unless you specifically look for\n\n"444-" them. The only result of any option starting with 'udb' is an error\n\n"445" in the boot output.\n\n"446);447
···49#include "irq_user.h"50#include "irq_kern.h"51#include "ubd_user.h"052#include "os.h"53#include "mem.h"54#include "mem_kern.h"···440__setup("udb", udb_setup);441__uml_help(udb_setup,442"udb\n"443+" This option is here solely to catch ubd -> udb typos, which can be\n"444+" to impossible to catch visually unless you specifically look for\n"445+" them. The only result of any option starting with 'udb' is an error\n"446" in the boot output.\n\n"447);448
-24
arch/um/include/2_5compat.h
···1-/* 2- * Copyright (C) 2001 Jeff Dike (jdike@karaya.com)3- * Licensed under the GPL4- */5-6-#ifndef __2_5_COMPAT_H__7-#define __2_5_COMPAT_H__8-9-#define INIT_HARDSECT(arr, maj, sizes)10-11-#define SET_PRI(task) do ; while(0)12-13-#endif14-15-/*16- * Overrides for Emacs so that we follow Linus's tabbing style.17- * Emacs will notice this stuff at the end of the file and automatically18- * adjust the settings for this buffer only. This must remain at the end19- * of the file.20- * ---------------------------------------------------------------------------21- * Local variables:22- * c-file-style: "linux"23- * End:24- */
···000000000000000000000000
+2-1
arch/um/include/sysrq.h
···1#ifndef __UM_SYSRQ_H2#define __UM_SYSRQ_H34-extern void show_trace(unsigned long *stack);056#endif
···1-/*2- * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)3- * Licensed under the GPL4- */5-6-#include "linux/init.h"7-#include "linux/bootmem.h"8-#include "linux/initrd.h"9-#include "asm/types.h"10-#include "user_util.h"11-#include "kern_util.h"12-#include "initrd.h"13-#include "init.h"14-#include "os.h"15-16-/* Changed by uml_initrd_setup, which is a setup */17-static char *initrd __initdata = NULL;18-19-static int __init read_initrd(void)20-{21- void *area;22- long long size;23- int err;24-25- if(initrd == NULL) return 0;26- err = os_file_size(initrd, &size);27- if(err) return 0;28- area = alloc_bootmem(size);29- if(area == NULL) return 0;30- if(load_initrd(initrd, area, size) == -1) return 0;31- initrd_start = (unsigned long) area;32- initrd_end = initrd_start + size;33- return 0;34-}35-36-__uml_postsetup(read_initrd);37-38-static int __init uml_initrd_setup(char *line, int *add)39-{40- initrd = line;41- return 0;42-}43-44-__uml_setup("initrd=", uml_initrd_setup, 45-"initrd=<initrd image>\n"46-" This is used to boot UML from an initrd image. The argument is the\n"47-" name of the file containing the image.\n\n"48-);49-50-/*51- * Overrides for Emacs so that we follow Linus's tabbing style.52- * Emacs will notice this stuff at the end of the file and automatically53- * adjust the settings for this buffer only. This must remain at the end54- * of the file.55- * ---------------------------------------------------------------------------56- * Local variables:57- * c-file-style: "linux"58- * End:59- */
···1-/*2- * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com)3- * Licensed under the GPL4- */5-6-#include <unistd.h>7-#include <sys/types.h>8-#include <sys/stat.h>9-#include <errno.h>10-11-#include "user_util.h"12-#include "kern_util.h"13-#include "user.h"14-#include "initrd.h"15-#include "os.h"16-17-int load_initrd(char *filename, void *buf, int size)18-{19- int fd, n;20-21- fd = os_open_file(filename, of_read(OPENFLAGS()), 0);22- if(fd < 0){23- printk("Opening '%s' failed - err = %d\n", filename, -fd);24- return(-1);25- }26- n = os_read_file(fd, buf, size);27- if(n != size){28- printk("Read of %d bytes from '%s' failed, err = %d\n", size,29- filename, -n);30- return(-1);31- }32-33- os_close_file(fd);34- return(0);35-}36-37-/*38- * Overrides for Emacs so that we follow Linus's tabbing style.39- * Emacs will notice this stuff at the end of the file and automatically40- * adjust the settings for this buffer only. This must remain at the end41- * of the file.42- * ---------------------------------------------------------------------------43- * Local variables:44- * c-file-style: "linux"45- * End:46- */
···0000000000000000000000000000000000000000000000
+22-20
arch/um/kernel/main.c
···7172static void last_ditch_exit(int sig)73{74- CHOOSE_MODE(kmalloc_ok = 0, (void) 0);75 signal(SIGINT, SIG_DFL);76 signal(SIGTERM, SIG_DFL);77 signal(SIGHUP, SIG_DFL);···87{88 char **new_argv;89 sigset_t mask;90- int ret, i;9192 /* Enable all signals except SIGIO - in some environments, we can93 * enter with some signals blocked···160 */161 change_sig(SIGPROF, 0);16200000000000000000000163 /* Reboot */164 if(ret){165- int err;166-167 printf("\n");168-169- /* stop timers and set SIG*ALRM to be ignored */170- disable_timer();171-172- /* disable SIGIO for the fds and set SIGIO to be ignored */173- err = deactivate_all_fds();174- if(err)175- printf("deactivate_all_fds failed, errno = %d\n",176- -err);177-178- /* Let any pending signals fire now. This ensures179- * that they won't be delivered after the exec, when180- * they are definitely not expected.181- */182- unblock_signals();183-184 execvp(new_argv[0], new_argv);185 perror("Failed to exec kernel");186 ret = 1;
···7172static void last_ditch_exit(int sig)73{74+ kmalloc_ok = 0;75 signal(SIGINT, SIG_DFL);76 signal(SIGTERM, SIG_DFL);77 signal(SIGHUP, SIG_DFL);···87{88 char **new_argv;89 sigset_t mask;90+ int ret, i, err;9192 /* Enable all signals except SIGIO - in some environments, we can93 * enter with some signals blocked···160 */161 change_sig(SIGPROF, 0);162163+ /* This signal stuff used to be in the reboot case. However,164+ * sometimes a SIGVTALRM can come in when we're halting (reproducably165+ * when writing out gcov information, presumably because that takes166+ * some time) and cause a segfault.167+ */168+169+ /* stop timers and set SIG*ALRM to be ignored */170+ disable_timer();171+172+ /* disable SIGIO for the fds and set SIGIO to be ignored */173+ err = deactivate_all_fds();174+ if(err)175+ printf("deactivate_all_fds failed, errno = %d\n", -err);176+177+ /* Let any pending signals fire now. This ensures178+ * that they won't be delivered after the exec, when179+ * they are definitely not expected.180+ */181+ unblock_signals();182+183 /* Reboot */184 if(ret){00185 printf("\n");0000000000000000186 execvp(new_argv[0], new_argv);187 perror("Failed to exec kernel");188 ret = 1;
-36
arch/um/kernel/process_kern.c
···43#include "tlb.h"44#include "frame_kern.h"45#include "sigcontext.h"46-#include "2_5compat.h"47#include "os.h"48#include "mode.h"49#include "mode_kern.h"···53 * entry.54 */55struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };56-57-struct task_struct *get_task(int pid, int require)58-{59- struct task_struct *ret;60-61- read_lock(&tasklist_lock);62- ret = find_task_by_pid(pid);63- read_unlock(&tasklist_lock);64-65- if(require && (ret == NULL)) panic("get_task couldn't find a task\n");66- return(ret);67-}6869int external_pid(void *t)70{···176177 while(1){178 /* endless idle loop with no priority at all */179- SET_PRI(current);180181 /*182 * although we are an idle CPU, we do not want to···196int page_size(void)197{198 return(PAGE_SIZE);199-}200-201-unsigned long page_mask(void)202-{203- return(PAGE_MASK);204}205206void *um_virt_to_phys(struct task_struct *task, unsigned long addr, ···330 return(new);331}332333-void *get_init_task(void)334-{335- return(&init_thread_union.thread_info.task);336-}337-338int copy_to_user_proc(void __user *to, void *from, int size)339{340 return(copy_to_user(to, from, size));···456 return sp & ~0xf;457}458#endif459-460-461-/*462- * Overrides for Emacs so that we follow Linus's tabbing style.463- * Emacs will notice this stuff at the end of the file and automatically464- * adjust the settings for this buffer only. This must remain at the end465- * of the file.466- * ---------------------------------------------------------------------------467- * Local variables:468- * c-file-style: "linux"469- * End:470- */
···43#include "tlb.h"44#include "frame_kern.h"45#include "sigcontext.h"046#include "os.h"47#include "mode.h"48#include "mode_kern.h"···54 * entry.55 */56struct cpu_task cpu_tasks[NR_CPUS] = { [0 ... NR_CPUS - 1] = { -1, NULL } };0000000000005758int external_pid(void *t)59{···189190 while(1){191 /* endless idle loop with no priority at all */0192193 /*194 * although we are an idle CPU, we do not want to···210int page_size(void)211{212 return(PAGE_SIZE);00000213}214215void *um_virt_to_phys(struct task_struct *task, unsigned long addr, ···349 return(new);350}35100000352int copy_to_user_proc(void __user *to, void *from, int size)353{354 return(copy_to_user(to, from, size));···480 return sp & ~0xf;481}482#endif000000000000
+3-16
arch/um/kernel/ptrace.c
···322 UPT_SYSCALL_ARG2(regs),323 UPT_SYSCALL_ARG3(regs),324 UPT_SYSCALL_ARG4(regs));325- else {326- int res = UPT_SYSCALL_RET(regs);327- audit_syscall_exit(current, AUDITSC_RESULT(res),328- res);329- }330 }331332 /* Fake a debug trap */···354 current->exit_code = 0;355 }356}357-358-/*359- * Overrides for Emacs so that we follow Linus's tabbing style.360- * Emacs will notice this stuff at the end of the file and automatically361- * adjust the settings for this buffer only. This must remain at the end362- * of the file.363- * ---------------------------------------------------------------------------364- * Local variables:365- * c-file-style: "linux"366- * End:367- */
···3 * Licensed under the GPL4 */506#include "linux/sched.h"7#include "linux/kernel.h"8#include "linux/module.h"···13#include "sysrq.h"14#include "user_util.h"1516-void show_trace(unsigned long * stack)0017{18- /* XXX: Copy the CONFIG_FRAME_POINTER stack-walking backtrace from19- * arch/i386/kernel/traps.c, and then move this to sys-i386/sysrq.c.*/20 unsigned long addr;2122 if (!stack) {23- stack = (unsigned long*) &stack;24 WARN_ON(1);25 }26···36 }37 printk("\n");38}03940/*41 * stack dumps generator - this is used by arch-independent code.···46{47 unsigned long stack;4849- show_trace(&stack);50}51EXPORT_SYMBOL(dump_stack);52···61 int i;6263 if (esp == NULL) {64- if (task != current) {000065 esp = (unsigned long *) KSTK_ESP(task);66 /* Which one? No actual difference - just coding style.*/67 //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs);···83 printk("%08lx ", *stack++);84 }8586- show_trace(esp);087}
···3 * Licensed under the GPL4 */56+#include "linux/config.h"7#include "linux/sched.h"8#include "linux/kernel.h"9#include "linux/module.h"···12#include "sysrq.h"13#include "user_util.h"1415+/* Catch non-i386 SUBARCH's. */16+#if !defined(CONFIG_UML_X86) || defined(CONFIG_64BIT)17+void show_trace(struct task_struct *task, unsigned long * stack)18{0019 unsigned long addr;2021 if (!stack) {22+ stack = (unsigned long*) &stack;23 WARN_ON(1);24 }25···35 }36 printk("\n");37}38+#endif3940/*41 * stack dumps generator - this is used by arch-independent code.···44{45 unsigned long stack;4647+ show_trace(current, &stack);48}49EXPORT_SYMBOL(dump_stack);50···59 int i;6061 if (esp == NULL) {62+ if (task != current && task != NULL) {63+ /* XXX: Isn't this bogus? I.e. isn't this the64+ * *userspace* stack of this task? If not so, use this65+ * even when task == current (as in i386).66+ */67 esp = (unsigned long *) KSTK_ESP(task);68 /* Which one? No actual difference - just coding style.*/69 //esp = (unsigned long *) PT_REGS_IP(&task->thread.regs);···77 printk("%08lx ", *stack++);78 }7980+ printk("Call Trace: \n");81+ show_trace(current, esp);82}
···32 unsigned long flags;33 int err, vtalrm, alrm, prof, cpu;34 char c;35- /* jailing and SMP are incompatible, so this doesn't need to be 36- * made per-cpu 37- */38- static int reading;3940 from = prev;41 to = next;···55 c = 0;56 set_current(to);5758- reading = 0;59 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));60 if(err != sizeof(c))61 panic("write of switch_pipe failed, err = %d", -err);6263- reading = 1;64- if(from->thread.mode.tt.switch_pipe[0] == -1)65 os_kill_process(os_getpid(), 0);6667 err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c));
···32 unsigned long flags;33 int err, vtalrm, alrm, prof, cpu;34 char c;00003536 from = prev;37 to = next;···59 c = 0;60 set_current(to);61062 err = os_write_file(to->thread.mode.tt.switch_pipe[1], &c, sizeof(c));63 if(err != sizeof(c))64 panic("write of switch_pipe failed, err = %d", -err);6566+ if(from->thread.mode.tt.switch_pipe[0] == -1)067 os_kill_process(os_getpid(), 0);6869 err = os_read_file(from->thread.mode.tt.switch_pipe[0], &c, sizeof(c));
-6
arch/um/kernel/um_arch.c
···111 .show = show_cpuinfo,112};113114-pte_t * __bad_pagetable(void)115-{116- panic("Someone should implement __bad_pagetable");117- return(NULL);118-}119-120/* Set in linux_main */121unsigned long host_task_size;122unsigned long task_size;
···111 .show = show_cpuinfo,112};113000000114/* Set in linux_main */115unsigned long host_task_size;116unsigned long task_size;
+79-1
arch/um/sys-i386/sysrq.c
···3 * Licensed under the GPL4 */506#include "linux/kernel.h"7#include "linux/smp.h"8#include "linux/sched.h"09#include "asm/ptrace.h"10#include "sysrq.h"11012void show_regs(struct pt_regs *regs)13{14 printk("\n");···34 0xffff & PT_REGS_DS(regs), 35 0xffff & PT_REGS_ES(regs));3637- show_trace((unsigned long *) ®s);38}000000000000000000000000000000000000000000000000000000000000000000000000000
···3 * Licensed under the GPL4 */56+#include "linux/config.h"7#include "linux/kernel.h"8#include "linux/smp.h"9#include "linux/sched.h"10+#include "linux/kallsyms.h"11#include "asm/ptrace.h"12#include "sysrq.h"1314+/* This is declared by <linux/sched.h> */15void show_regs(struct pt_regs *regs)16{17 printk("\n");···31 0xffff & PT_REGS_DS(regs), 32 0xffff & PT_REGS_ES(regs));3334+ show_trace(NULL, (unsigned long *) ®s);35}36+37+/* Copied from i386. */38+static inline int valid_stack_ptr(struct thread_info *tinfo, void *p)39+{40+ return p > (void *)tinfo &&41+ p < (void *)tinfo + THREAD_SIZE - 3;42+}43+44+/* Adapted from i386 (we also print the address we read from). */45+static inline unsigned long print_context_stack(struct thread_info *tinfo,46+ unsigned long *stack, unsigned long ebp)47+{48+ unsigned long addr;49+50+#ifdef CONFIG_FRAME_POINTER51+ while (valid_stack_ptr(tinfo, (void *)ebp)) {52+ addr = *(unsigned long *)(ebp + 4);53+ printk("%08lx: [<%08lx>]", ebp + 4, addr);54+ print_symbol(" %s", addr);55+ printk("\n");56+ ebp = *(unsigned long *)ebp;57+ }58+#else59+ while (valid_stack_ptr(tinfo, stack)) {60+ addr = *stack;61+ if (__kernel_text_address(addr)) {62+ printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);63+ print_symbol(" %s", addr);64+ printk("\n");65+ }66+ stack++;67+ }68+#endif69+ return ebp;70+}71+72+void show_trace(struct task_struct* task, unsigned long * stack)73+{74+ unsigned long ebp;75+ struct thread_info *context;76+77+ /* Turn this into BUG_ON if possible. */78+ if (!stack) {79+ stack = (unsigned long*) &stack;80+ printk("show_trace: got NULL stack, implicit assumption task == current");81+ WARN_ON(1);82+ }83+84+ if (!task)85+ task = current;86+87+ if (task != current) {88+ //ebp = (unsigned long) KSTK_EBP(task);89+ /* Which one? No actual difference - just coding style.*/90+ ebp = (unsigned long) PT_REGS_EBP(&task->thread.regs);91+ } else {92+ asm ("movl %%ebp, %0" : "=r" (ebp) : );93+ }94+95+ context = (struct thread_info *)96+ ((unsigned long)stack & (~(THREAD_SIZE - 1)));97+ print_context_stack(context, stack, ebp);98+99+ /*while (((long) stack & (THREAD_SIZE-1)) != 0) {100+ addr = *stack;101+ if (__kernel_text_address(addr)) {102+ printk("%08lx: [<%08lx>]", (unsigned long) stack, addr);103+ print_symbol(" %s", addr);104+ printk("\n");105+ }106+ stack++;107+ }*/108+ printk("\n");109+}110+
+1-13
arch/um/sys-ppc/sysrq.c
···27 0xffff & regs->xds, 0xffff & regs->xes);28#endif2930- show_trace(®s->gpr[1]);31}32-33-34-/*35- * Overrides for Emacs so that we follow Linus's tabbing style.36- * Emacs will notice this stuff at the end of the file and automatically37- * adjust the settings for this buffer only. This must remain at the end38- * of the file.39- * ---------------------------------------------------------------------------40- * Local variables:41- * c-file-style: "linux"42- * End:43- */
···133134#ifdef CONFIG_MODE_SKAS1350136static long arch_prctl_skas(int code, unsigned long addr)137{138 long ret = 0;139140 switch(code){141- case ARCH_SET_GS:142- current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;143- break;144 case ARCH_SET_FS:145 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr;146 break;000147 case ARCH_GET_FS:148- ret = put_user(current->thread.regs.regs.skas.regs[GS / sizeof(unsigned long)], &addr);00149 break;150 case ARCH_GET_GS:151- ret = put_user(current->thread.regs.regs.skas.regs[FS / sizeof(unsigned \152-long)], &addr);0153 break;154 default:155 ret = -EINVAL;
···133134#ifdef CONFIG_MODE_SKAS135136+/* XXX: Must also call arch_prctl in the host, beside saving the segment bases! */137static long arch_prctl_skas(int code, unsigned long addr)138{139 long ret = 0;140141 switch(code){000142 case ARCH_SET_FS:143 current->thread.regs.regs.skas.regs[FS_BASE / sizeof(unsigned long)] = addr;144 break;145+ case ARCH_SET_GS:146+ current->thread.regs.regs.skas.regs[GS_BASE / sizeof(unsigned long)] = addr;147+ break;148 case ARCH_GET_FS:149+ ret = put_user(current->thread.regs.regs.skas.150+ regs[FS_BASE / sizeof(unsigned long)],151+ (unsigned long __user *)addr);152 break;153 case ARCH_GET_GS:154+ ret = put_user(current->thread.regs.regs.skas.155+ regs[GS_BASE / sizeof(unsigned long)],156+ (unsigned long __user *)addr);157 break;158 default:159 ret = -EINVAL;
+1-10
arch/um/sys-x86_64/sysrq.c
···36void show_regs(struct pt_regs *regs)37{38 __show_regs(regs);39- show_trace((unsigned long *) ®s);40}41-42-/* Emacs will notice this stuff at the end of the file and automatically43- * adjust the settings for this buffer only. This must remain at the end44- * of the file.45- * ---------------------------------------------------------------------------46- * Local variables:47- * c-file-style: "linux"48- * End:49- */
···36void show_regs(struct pt_regs *regs)37{38 __show_regs(regs);39+ show_trace(current, (unsigned long *) ®s);40}000000000
+1
arch/x86_64/Kconfig
···305306config X86_PM_TIMER307 bool "PM timer"0308 default y309 help310 Support the ACPI PM timer for time keeping. This is slow,
···305306config X86_PM_TIMER307 bool "PM timer"308+ depends on ACPI309 default y310 help311 Support the ACPI PM timer for time keeping. This is slow,
···30#include <asm/pgalloc.h>31#include <asm/io_apic.h>32#include <asm/proto.h>03334/* Have we found an MP table */35int smp_found_config;
···30#include <asm/pgalloc.h>31#include <asm/io_apic.h>32#include <asm/proto.h>33+#include <asm/acpi.h>3435/* Have we found an MP table */36int smp_found_config;
···46 This will show detail CPU frequency translation table in sysfs file47 system48000049choice50 prompt "Default CPUFreq governor"51 default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110···114 The support for this governor depends on CPU capability to115 do fast frequency switching (i.e, very low latency frequency116 transitions). 00000000000000000000117118 For details, take a look at linux/Documentation/cpu-freq.119
···46 This will show detail CPU frequency translation table in sysfs file47 system4849+# Note that it is not currently possible to set the other governors (such as ondemand)50+# as the default, since if they fail to initialise, cpufreq will be51+# left in an undefined state.52+53choice54 prompt "Default CPUFreq governor"55 default CPU_FREQ_DEFAULT_GOV_USERSPACE if CPU_FREQ_SA1100 || CPU_FREQ_SA1110···110 The support for this governor depends on CPU capability to111 do fast frequency switching (i.e, very low latency frequency112 transitions). 113+114+ For details, take a look at linux/Documentation/cpu-freq.115+116+ If in doubt, say N.117+118+config CPU_FREQ_GOV_CONSERVATIVE119+ tristate "'conservative' cpufreq governor"120+ depends on CPU_FREQ121+ help122+ 'conservative' - this driver is rather similar to the 'ondemand'123+ governor both in its source code and its purpose, the difference is124+ its optimisation for better suitability in a battery powered125+ environment. The frequency is gracefully increased and decreased126+ rather than jumping to 100% when speed is required.127+128+ If you have a desktop machine then you should really be considering129+ the 'ondemand' governor instead, however if you are using a laptop,130+ PDA or even an AMD64 based computer (due to the unacceptable131+ step-by-step latency issues between the minimum and maximum frequency132+ transitions in the CPU) you will probably want to use this governor.133134 For details, take a look at linux/Documentation/cpu-freq.135
···1+/*2+ * drivers/cpufreq/cpufreq_conservative.c3+ *4+ * Copyright (C) 2001 Russell King5+ * (C) 2003 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>.6+ * Jun Nakajima <jun.nakajima@intel.com>7+ * (C) 2004 Alexander Clouter <alex-kernel@digriz.org.uk>8+ *9+ * This program is free software; you can redistribute it and/or modify10+ * it under the terms of the GNU General Public License version 2 as11+ * published by the Free Software Foundation.12+ */13+14+#include <linux/kernel.h>15+#include <linux/module.h>16+#include <linux/smp.h>17+#include <linux/init.h>18+#include <linux/interrupt.h>19+#include <linux/ctype.h>20+#include <linux/cpufreq.h>21+#include <linux/sysctl.h>22+#include <linux/types.h>23+#include <linux/fs.h>24+#include <linux/sysfs.h>25+#include <linux/sched.h>26+#include <linux/kmod.h>27+#include <linux/workqueue.h>28+#include <linux/jiffies.h>29+#include <linux/kernel_stat.h>30+#include <linux/percpu.h>31+32+/*33+ * dbs is used in this file as a shortform for demandbased switching34+ * It helps to keep variable names smaller, simpler35+ */36+37+#define DEF_FREQUENCY_UP_THRESHOLD (80)38+#define MIN_FREQUENCY_UP_THRESHOLD (0)39+#define MAX_FREQUENCY_UP_THRESHOLD (100)40+41+#define DEF_FREQUENCY_DOWN_THRESHOLD (20)42+#define MIN_FREQUENCY_DOWN_THRESHOLD (0)43+#define MAX_FREQUENCY_DOWN_THRESHOLD (100)44+45+/* 46+ * The polling frequency of this governor depends on the capability of 47+ * the processor. Default polling frequency is 1000 times the transition48+ * latency of the processor. The governor will work on any processor with 49+ * transition latency <= 10mS, using appropriate sampling 50+ * rate.51+ * For CPUs with transition latency > 10mS (mostly drivers with CPUFREQ_ETERNAL)52+ * this governor will not work.53+ * All times here are in uS.54+ */55+static unsigned int def_sampling_rate;56+#define MIN_SAMPLING_RATE (def_sampling_rate / 2)57+#define MAX_SAMPLING_RATE (500 * def_sampling_rate)58+#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (100000)59+#define DEF_SAMPLING_DOWN_FACTOR (5)60+#define TRANSITION_LATENCY_LIMIT (10 * 1000)61+62+static void do_dbs_timer(void *data);63+64+struct cpu_dbs_info_s {65+ struct cpufreq_policy *cur_policy;66+ unsigned int prev_cpu_idle_up;67+ unsigned int prev_cpu_idle_down;68+ unsigned int enable;69+};70+static DEFINE_PER_CPU(struct cpu_dbs_info_s, cpu_dbs_info);71+72+static unsigned int dbs_enable; /* number of CPUs using this policy */73+74+static DECLARE_MUTEX (dbs_sem);75+static DECLARE_WORK (dbs_work, do_dbs_timer, NULL);76+77+struct dbs_tuners {78+ unsigned int sampling_rate;79+ unsigned int sampling_down_factor;80+ unsigned int up_threshold;81+ unsigned int down_threshold;82+ unsigned int ignore_nice;83+ unsigned int freq_step;84+};85+86+static struct dbs_tuners dbs_tuners_ins = {87+ .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,88+ .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,89+ .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,90+};91+92+static inline unsigned int get_cpu_idle_time(unsigned int cpu)93+{94+ return kstat_cpu(cpu).cpustat.idle +95+ kstat_cpu(cpu).cpustat.iowait +96+ ( !dbs_tuners_ins.ignore_nice ? 97+ kstat_cpu(cpu).cpustat.nice :98+ 0);99+}100+101+/************************** sysfs interface ************************/102+static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)103+{104+ return sprintf (buf, "%u\n", MAX_SAMPLING_RATE);105+}106+107+static ssize_t show_sampling_rate_min(struct cpufreq_policy *policy, char *buf)108+{109+ return sprintf (buf, "%u\n", MIN_SAMPLING_RATE);110+}111+112+#define define_one_ro(_name) \113+static struct freq_attr _name = \114+__ATTR(_name, 0444, show_##_name, NULL)115+116+define_one_ro(sampling_rate_max);117+define_one_ro(sampling_rate_min);118+119+/* cpufreq_conservative Governor Tunables */120+#define show_one(file_name, object) \121+static ssize_t show_##file_name \122+(struct cpufreq_policy *unused, char *buf) \123+{ \124+ return sprintf(buf, "%u\n", dbs_tuners_ins.object); \125+}126+show_one(sampling_rate, sampling_rate);127+show_one(sampling_down_factor, sampling_down_factor);128+show_one(up_threshold, up_threshold);129+show_one(down_threshold, down_threshold);130+show_one(ignore_nice, ignore_nice);131+show_one(freq_step, freq_step);132+133+static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 134+ const char *buf, size_t count)135+{136+ unsigned int input;137+ int ret;138+ ret = sscanf (buf, "%u", &input);139+ if (ret != 1 )140+ return -EINVAL;141+142+ down(&dbs_sem);143+ dbs_tuners_ins.sampling_down_factor = input;144+ up(&dbs_sem);145+146+ return count;147+}148+149+static ssize_t store_sampling_rate(struct cpufreq_policy *unused, 150+ const char *buf, size_t count)151+{152+ unsigned int input;153+ int ret;154+ ret = sscanf (buf, "%u", &input);155+156+ down(&dbs_sem);157+ if (ret != 1 || input > MAX_SAMPLING_RATE || input < MIN_SAMPLING_RATE) {158+ up(&dbs_sem);159+ return -EINVAL;160+ }161+162+ dbs_tuners_ins.sampling_rate = input;163+ up(&dbs_sem);164+165+ return count;166+}167+168+static ssize_t store_up_threshold(struct cpufreq_policy *unused, 169+ const char *buf, size_t count)170+{171+ unsigned int input;172+ int ret;173+ ret = sscanf (buf, "%u", &input);174+175+ down(&dbs_sem);176+ if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || 177+ input < MIN_FREQUENCY_UP_THRESHOLD ||178+ input <= dbs_tuners_ins.down_threshold) {179+ up(&dbs_sem);180+ return -EINVAL;181+ }182+183+ dbs_tuners_ins.up_threshold = input;184+ up(&dbs_sem);185+186+ return count;187+}188+189+static ssize_t store_down_threshold(struct cpufreq_policy *unused, 190+ const char *buf, size_t count)191+{192+ unsigned int input;193+ int ret;194+ ret = sscanf (buf, "%u", &input);195+196+ down(&dbs_sem);197+ if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD || 198+ input < MIN_FREQUENCY_DOWN_THRESHOLD ||199+ input >= dbs_tuners_ins.up_threshold) {200+ up(&dbs_sem);201+ return -EINVAL;202+ }203+204+ dbs_tuners_ins.down_threshold = input;205+ up(&dbs_sem);206+207+ return count;208+}209+210+static ssize_t store_ignore_nice(struct cpufreq_policy *policy,211+ const char *buf, size_t count)212+{213+ unsigned int input;214+ int ret;215+216+ unsigned int j;217+218+ ret = sscanf (buf, "%u", &input);219+ if ( ret != 1 )220+ return -EINVAL;221+222+ if ( input > 1 )223+ input = 1;224+225+ down(&dbs_sem);226+ if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */227+ up(&dbs_sem);228+ return count;229+ }230+ dbs_tuners_ins.ignore_nice = input;231+232+ /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */233+ for_each_online_cpu(j) {234+ struct cpu_dbs_info_s *j_dbs_info;235+ j_dbs_info = &per_cpu(cpu_dbs_info, j);236+ j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);237+ j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;238+ }239+ up(&dbs_sem);240+241+ return count;242+}243+244+static ssize_t store_freq_step(struct cpufreq_policy *policy,245+ const char *buf, size_t count)246+{247+ unsigned int input;248+ int ret;249+250+ ret = sscanf (buf, "%u", &input);251+252+ if ( ret != 1 )253+ return -EINVAL;254+255+ if ( input > 100 )256+ input = 100;257+258+ /* no need to test here if freq_step is zero as the user might actually259+ * want this, they would be crazy though :) */260+ down(&dbs_sem);261+ dbs_tuners_ins.freq_step = input;262+ up(&dbs_sem);263+264+ return count;265+}266+267+#define define_one_rw(_name) \268+static struct freq_attr _name = \269+__ATTR(_name, 0644, show_##_name, store_##_name)270+271+define_one_rw(sampling_rate);272+define_one_rw(sampling_down_factor);273+define_one_rw(up_threshold);274+define_one_rw(down_threshold);275+define_one_rw(ignore_nice);276+define_one_rw(freq_step);277+278+static struct attribute * dbs_attributes[] = {279+ &sampling_rate_max.attr,280+ &sampling_rate_min.attr,281+ &sampling_rate.attr,282+ &sampling_down_factor.attr,283+ &up_threshold.attr,284+ &down_threshold.attr,285+ &ignore_nice.attr,286+ &freq_step.attr,287+ NULL288+};289+290+static struct attribute_group dbs_attr_group = {291+ .attrs = dbs_attributes,292+ .name = "conservative",293+};294+295+/************************** sysfs end ************************/296+297+static void dbs_check_cpu(int cpu)298+{299+ unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;300+ unsigned int freq_step;301+ unsigned int freq_down_sampling_rate;302+ static int down_skip[NR_CPUS];303+ static int requested_freq[NR_CPUS];304+ static unsigned short init_flag = 0;305+ struct cpu_dbs_info_s *this_dbs_info;306+ struct cpu_dbs_info_s *dbs_info;307+308+ struct cpufreq_policy *policy;309+ unsigned int j;310+311+ this_dbs_info = &per_cpu(cpu_dbs_info, cpu);312+ if (!this_dbs_info->enable)313+ return;314+315+ policy = this_dbs_info->cur_policy;316+317+ if ( init_flag == 0 ) {318+ for ( /* NULL */; init_flag < NR_CPUS; init_flag++ ) {319+ dbs_info = &per_cpu(cpu_dbs_info, init_flag);320+ requested_freq[cpu] = dbs_info->cur_policy->cur;321+ }322+ init_flag = 1;323+ }324+325+ /* 326+ * The default safe range is 20% to 80% 327+ * Every sampling_rate, we check328+ * - If current idle time is less than 20%, then we try to 329+ * increase frequency330+ * Every sampling_rate*sampling_down_factor, we check331+ * - If current idle time is more than 80%, then we try to332+ * decrease frequency333+ *334+ * Any frequency increase takes it to the maximum frequency. 335+ * Frequency reduction happens at minimum steps of 336+ * 5% (default) of max_frequency 337+ */338+339+ /* Check for frequency increase */340+341+ idle_ticks = UINT_MAX;342+ for_each_cpu_mask(j, policy->cpus) {343+ unsigned int tmp_idle_ticks, total_idle_ticks;344+ struct cpu_dbs_info_s *j_dbs_info;345+346+ j_dbs_info = &per_cpu(cpu_dbs_info, j);347+ /* Check for frequency increase */348+ total_idle_ticks = get_cpu_idle_time(j);349+ tmp_idle_ticks = total_idle_ticks -350+ j_dbs_info->prev_cpu_idle_up;351+ j_dbs_info->prev_cpu_idle_up = total_idle_ticks;352+353+ if (tmp_idle_ticks < idle_ticks)354+ idle_ticks = tmp_idle_ticks;355+ }356+357+ /* Scale idle ticks by 100 and compare with up and down ticks */358+ idle_ticks *= 100;359+ up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *360+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate);361+362+ if (idle_ticks < up_idle_ticks) {363+ down_skip[cpu] = 0;364+ for_each_cpu_mask(j, policy->cpus) {365+ struct cpu_dbs_info_s *j_dbs_info;366+367+ j_dbs_info = &per_cpu(cpu_dbs_info, j);368+ j_dbs_info->prev_cpu_idle_down = 369+ j_dbs_info->prev_cpu_idle_up;370+ }371+ /* if we are already at full speed then break out early */372+ if (requested_freq[cpu] == policy->max)373+ return;374+375+ freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;376+377+ /* max freq cannot be less than 100. But who knows.... */378+ if (unlikely(freq_step == 0))379+ freq_step = 5;380+381+ requested_freq[cpu] += freq_step;382+ if (requested_freq[cpu] > policy->max)383+ requested_freq[cpu] = policy->max;384+385+ __cpufreq_driver_target(policy, requested_freq[cpu], 386+ CPUFREQ_RELATION_H);387+ return;388+ }389+390+ /* Check for frequency decrease */391+ down_skip[cpu]++;392+ if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)393+ return;394+395+ idle_ticks = UINT_MAX;396+ for_each_cpu_mask(j, policy->cpus) {397+ unsigned int tmp_idle_ticks, total_idle_ticks;398+ struct cpu_dbs_info_s *j_dbs_info;399+400+ j_dbs_info = &per_cpu(cpu_dbs_info, j);401+ total_idle_ticks = j_dbs_info->prev_cpu_idle_up;402+ tmp_idle_ticks = total_idle_ticks -403+ j_dbs_info->prev_cpu_idle_down;404+ j_dbs_info->prev_cpu_idle_down = total_idle_ticks;405+406+ if (tmp_idle_ticks < idle_ticks)407+ idle_ticks = tmp_idle_ticks;408+ }409+410+ /* Scale idle ticks by 100 and compare with up and down ticks */411+ idle_ticks *= 100;412+ down_skip[cpu] = 0;413+414+ freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *415+ dbs_tuners_ins.sampling_down_factor;416+ down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *417+ usecs_to_jiffies(freq_down_sampling_rate);418+419+ if (idle_ticks > down_idle_ticks) {420+ /* if we are already at the lowest speed then break out early421+ * or if we 'cannot' reduce the speed as the user might want422+ * freq_step to be zero */423+ if (requested_freq[cpu] == policy->min424+ || dbs_tuners_ins.freq_step == 0)425+ return;426+427+ freq_step = (dbs_tuners_ins.freq_step * policy->max) / 100;428+429+ /* max freq cannot be less than 100. But who knows.... */430+ if (unlikely(freq_step == 0))431+ freq_step = 5;432+433+ requested_freq[cpu] -= freq_step;434+ if (requested_freq[cpu] < policy->min)435+ requested_freq[cpu] = policy->min;436+437+ __cpufreq_driver_target(policy,438+ requested_freq[cpu],439+ CPUFREQ_RELATION_H);440+ return;441+ }442+}443+444+static void do_dbs_timer(void *data)445+{ 446+ int i;447+ down(&dbs_sem);448+ for_each_online_cpu(i)449+ dbs_check_cpu(i);450+ schedule_delayed_work(&dbs_work, 451+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));452+ up(&dbs_sem);453+} 454+455+static inline void dbs_timer_init(void)456+{457+ INIT_WORK(&dbs_work, do_dbs_timer, NULL);458+ schedule_delayed_work(&dbs_work,459+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));460+ return;461+}462+463+static inline void dbs_timer_exit(void)464+{465+ cancel_delayed_work(&dbs_work);466+ return;467+}468+469+static int cpufreq_governor_dbs(struct cpufreq_policy *policy,470+ unsigned int event)471+{472+ unsigned int cpu = policy->cpu;473+ struct cpu_dbs_info_s *this_dbs_info;474+ unsigned int j;475+476+ this_dbs_info = &per_cpu(cpu_dbs_info, cpu);477+478+ switch (event) {479+ case CPUFREQ_GOV_START:480+ if ((!cpu_online(cpu)) || 481+ (!policy->cur))482+ return -EINVAL;483+484+ if (policy->cpuinfo.transition_latency >485+ (TRANSITION_LATENCY_LIMIT * 1000))486+ return -EINVAL;487+ if (this_dbs_info->enable) /* Already enabled */488+ break;489+490+ down(&dbs_sem);491+ for_each_cpu_mask(j, policy->cpus) {492+ struct cpu_dbs_info_s *j_dbs_info;493+ j_dbs_info = &per_cpu(cpu_dbs_info, j);494+ j_dbs_info->cur_policy = policy;495+496+ j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);497+ j_dbs_info->prev_cpu_idle_down498+ = j_dbs_info->prev_cpu_idle_up;499+ }500+ this_dbs_info->enable = 1;501+ sysfs_create_group(&policy->kobj, &dbs_attr_group);502+ dbs_enable++;503+ /*504+ * Start the timerschedule work, when this governor505+ * is used for first time506+ */507+ if (dbs_enable == 1) {508+ unsigned int latency;509+ /* policy latency is in nS. Convert it to uS first */510+511+ latency = policy->cpuinfo.transition_latency;512+ if (latency < 1000)513+ latency = 1000;514+515+ def_sampling_rate = (latency / 1000) *516+ DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;517+ dbs_tuners_ins.sampling_rate = def_sampling_rate;518+ dbs_tuners_ins.ignore_nice = 0;519+ dbs_tuners_ins.freq_step = 5;520+521+ dbs_timer_init();522+ }523+524+ up(&dbs_sem);525+ break;526+527+ case CPUFREQ_GOV_STOP:528+ down(&dbs_sem);529+ this_dbs_info->enable = 0;530+ sysfs_remove_group(&policy->kobj, &dbs_attr_group);531+ dbs_enable--;532+ /*533+ * Stop the timerschedule work, when this governor534+ * is used for first time535+ */536+ if (dbs_enable == 0) 537+ dbs_timer_exit();538+539+ up(&dbs_sem);540+541+ break;542+543+ case CPUFREQ_GOV_LIMITS:544+ down(&dbs_sem);545+ if (policy->max < this_dbs_info->cur_policy->cur)546+ __cpufreq_driver_target(547+ this_dbs_info->cur_policy,548+ policy->max, CPUFREQ_RELATION_H);549+ else if (policy->min > this_dbs_info->cur_policy->cur)550+ __cpufreq_driver_target(551+ this_dbs_info->cur_policy,552+ policy->min, CPUFREQ_RELATION_L);553+ up(&dbs_sem);554+ break;555+ }556+ return 0;557+}558+559+static struct cpufreq_governor cpufreq_gov_dbs = {560+ .name = "conservative",561+ .governor = cpufreq_governor_dbs,562+ .owner = THIS_MODULE,563+};564+565+static int __init cpufreq_gov_dbs_init(void)566+{567+ return cpufreq_register_governor(&cpufreq_gov_dbs);568+}569+570+static void __exit cpufreq_gov_dbs_exit(void)571+{572+ /* Make sure that the scheduled work is indeed not running */573+ flush_scheduled_work();574+575+ cpufreq_unregister_governor(&cpufreq_gov_dbs);576+}577+578+579+MODULE_AUTHOR ("Alexander Clouter <alex-kernel@digriz.org.uk>");580+MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "581+ "Low Latency Frequency Transition capable processors "582+ "optimised for use in a battery environment");583+MODULE_LICENSE ("GPL");584+585+module_init(cpufreq_gov_dbs_init);586+module_exit(cpufreq_gov_dbs_exit);
+94-92
drivers/cpufreq/cpufreq_ondemand.c
···34 */3536#define DEF_FREQUENCY_UP_THRESHOLD (80)37-#define MIN_FREQUENCY_UP_THRESHOLD (0)38#define MAX_FREQUENCY_UP_THRESHOLD (100)39-40-#define DEF_FREQUENCY_DOWN_THRESHOLD (20)41-#define MIN_FREQUENCY_DOWN_THRESHOLD (0)42-#define MAX_FREQUENCY_DOWN_THRESHOLD (100)4344/* 45 * The polling frequency of this governor depends on the capability of ···51#define MIN_SAMPLING_RATE (def_sampling_rate / 2)52#define MAX_SAMPLING_RATE (500 * def_sampling_rate)53#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)54-#define DEF_SAMPLING_DOWN_FACTOR (10)055#define TRANSITION_LATENCY_LIMIT (10 * 1000)56-#define sampling_rate_in_HZ(x) (((x * HZ) < (1000 * 1000))?1:((x * HZ) / (1000 * 1000)))5758static void do_dbs_timer(void *data);59···74 unsigned int sampling_rate;75 unsigned int sampling_down_factor;76 unsigned int up_threshold;77- unsigned int down_threshold;78};7980static struct dbs_tuners dbs_tuners_ins = {81 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,82- .down_threshold = DEF_FREQUENCY_DOWN_THRESHOLD,83 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,84};0000000008586/************************** sysfs interface ************************/87static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)···119show_one(sampling_rate, sampling_rate);120show_one(sampling_down_factor, sampling_down_factor);121show_one(up_threshold, up_threshold);122-show_one(down_threshold, down_threshold);123124static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 125 const char *buf, size_t count)···128 int ret;129 ret = sscanf (buf, "%u", &input);130 if (ret != 1 )000131 return -EINVAL;132133 down(&dbs_sem);···168169 down(&dbs_sem);170 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || 171- input < MIN_FREQUENCY_UP_THRESHOLD ||172- input <= dbs_tuners_ins.down_threshold) {173 up(&dbs_sem);174 return -EINVAL;175 }···179 return count;180}181182-static ssize_t store_down_threshold(struct cpufreq_policy *unused, 183 const char *buf, size_t count)184{185 unsigned int input;186 int ret;000187 ret = sscanf (buf, "%u", &input);188-189- down(&dbs_sem);190- if (ret != 1 || input > MAX_FREQUENCY_DOWN_THRESHOLD || 191- input < MIN_FREQUENCY_DOWN_THRESHOLD ||192- input >= dbs_tuners_ins.up_threshold) {193- up(&dbs_sem);194 return -EINVAL;195- }196197- dbs_tuners_ins.down_threshold = input;0000000000000000198 up(&dbs_sem);199200 return count;···220define_one_rw(sampling_rate);221define_one_rw(sampling_down_factor);222define_one_rw(up_threshold);223-define_one_rw(down_threshold);224225static struct attribute * dbs_attributes[] = {226 &sampling_rate_max.attr,···228 &sampling_rate.attr,229 &sampling_down_factor.attr,230 &up_threshold.attr,231- &down_threshold.attr,232 NULL233};234···241242static void dbs_check_cpu(int cpu)243{244- unsigned int idle_ticks, up_idle_ticks, down_idle_ticks;245- unsigned int total_idle_ticks;246- unsigned int freq_down_step;247 unsigned int freq_down_sampling_rate;248 static int down_skip[NR_CPUS];249 struct cpu_dbs_info_s *this_dbs_info;···256257 policy = this_dbs_info->cur_policy;258 /* 259- * The default safe range is 20% to 80% 260- * Every sampling_rate, we check261- * - If current idle time is less than 20%, then we try to 262- * increase frequency263- * Every sampling_rate*sampling_down_factor, we check264- * - If current idle time is more than 80%, then we try to265- * decrease frequency266 *267 * Any frequency increase takes it to the maximum frequency. 268 * Frequency reduction happens at minimum steps of 269- * 5% of max_frequency 270 */271272 /* Check for frequency increase */273- total_idle_ticks = kstat_cpu(cpu).cpustat.idle +274- kstat_cpu(cpu).cpustat.iowait;275- idle_ticks = total_idle_ticks -276- this_dbs_info->prev_cpu_idle_up;277- this_dbs_info->prev_cpu_idle_up = total_idle_ticks;278-279-280 for_each_cpu_mask(j, policy->cpus) {281- unsigned int tmp_idle_ticks;282 struct cpu_dbs_info_s *j_dbs_info;283284- if (j == cpu)285- continue;286-287 j_dbs_info = &per_cpu(cpu_dbs_info, j);288- /* Check for frequency increase */289- total_idle_ticks = kstat_cpu(j).cpustat.idle +290- kstat_cpu(j).cpustat.iowait;291 tmp_idle_ticks = total_idle_ticks -292 j_dbs_info->prev_cpu_idle_up;293 j_dbs_info->prev_cpu_idle_up = total_idle_ticks;···286 /* Scale idle ticks by 100 and compare with up and down ticks */287 idle_ticks *= 100;288 up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *289- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate);290291 if (idle_ticks < up_idle_ticks) {000000000000292 __cpufreq_driver_target(policy, policy->max, 293 CPUFREQ_RELATION_H);294- down_skip[cpu] = 0;295- this_dbs_info->prev_cpu_idle_down = total_idle_ticks;296 return;297 }298···311 if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)312 return;313314- total_idle_ticks = kstat_cpu(cpu).cpustat.idle +315- kstat_cpu(cpu).cpustat.iowait;316- idle_ticks = total_idle_ticks -317- this_dbs_info->prev_cpu_idle_down;318- this_dbs_info->prev_cpu_idle_down = total_idle_ticks;319-320 for_each_cpu_mask(j, policy->cpus) {321- unsigned int tmp_idle_ticks;322 struct cpu_dbs_info_s *j_dbs_info;323324- if (j == cpu)325- continue;326-327 j_dbs_info = &per_cpu(cpu_dbs_info, j);328- /* Check for frequency increase */329- total_idle_ticks = kstat_cpu(j).cpustat.idle +330- kstat_cpu(j).cpustat.iowait;331 tmp_idle_ticks = total_idle_ticks -332 j_dbs_info->prev_cpu_idle_down;333 j_dbs_info->prev_cpu_idle_down = total_idle_ticks;···327 idle_ticks = tmp_idle_ticks;328 }329330- /* Scale idle ticks by 100 and compare with up and down ticks */331- idle_ticks *= 100;332 down_skip[cpu] = 0;0003330334 freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *335 dbs_tuners_ins.sampling_down_factor;336- down_idle_ticks = (100 - dbs_tuners_ins.down_threshold) *337- sampling_rate_in_HZ(freq_down_sampling_rate);338339- if (idle_ticks > down_idle_ticks ) {340- freq_down_step = (5 * policy->max) / 100;000000341342- /* max freq cannot be less than 100. But who knows.... */343- if (unlikely(freq_down_step == 0))344- freq_down_step = 5;345-346- __cpufreq_driver_target(policy,347- policy->cur - freq_down_step, 348- CPUFREQ_RELATION_H);349- return;350- }351}352353static void do_dbs_timer(void *data)354{ 355 int i;356 down(&dbs_sem);357- for (i = 0; i < NR_CPUS; i++)358- if (cpu_online(i))359- dbs_check_cpu(i);360 schedule_delayed_work(&dbs_work, 361- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));362 up(&dbs_sem);363} 364···365{366 INIT_WORK(&dbs_work, do_dbs_timer, NULL);367 schedule_delayed_work(&dbs_work,368- sampling_rate_in_HZ(dbs_tuners_ins.sampling_rate));369 return;370}371···402 j_dbs_info = &per_cpu(cpu_dbs_info, j);403 j_dbs_info->cur_policy = policy;404405- j_dbs_info->prev_cpu_idle_up = 406- kstat_cpu(j).cpustat.idle +407- kstat_cpu(j).cpustat.iowait;408- j_dbs_info->prev_cpu_idle_down = 409- kstat_cpu(j).cpustat.idle +410- kstat_cpu(j).cpustat.iowait;411 }412 this_dbs_info->enable = 1;413 sysfs_create_group(&policy->kobj, &dbs_attr_group);···424 def_sampling_rate = (latency / 1000) *425 DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;426 dbs_tuners_ins.sampling_rate = def_sampling_rate;0427428 dbs_timer_init();429 }···464 return 0;465}466467-struct cpufreq_governor cpufreq_gov_dbs = {468 .name = "ondemand",469 .governor = cpufreq_governor_dbs,470 .owner = THIS_MODULE,471};472-EXPORT_SYMBOL(cpufreq_gov_dbs);473474static int __init cpufreq_gov_dbs_init(void)475{
···34 */3536#define DEF_FREQUENCY_UP_THRESHOLD (80)37+#define MIN_FREQUENCY_UP_THRESHOLD (11)38#define MAX_FREQUENCY_UP_THRESHOLD (100)00003940/* 41 * The polling frequency of this governor depends on the capability of ···55#define MIN_SAMPLING_RATE (def_sampling_rate / 2)56#define MAX_SAMPLING_RATE (500 * def_sampling_rate)57#define DEF_SAMPLING_RATE_LATENCY_MULTIPLIER (1000)58+#define DEF_SAMPLING_DOWN_FACTOR (1)59+#define MAX_SAMPLING_DOWN_FACTOR (10)60#define TRANSITION_LATENCY_LIMIT (10 * 1000)06162static void do_dbs_timer(void *data);63···78 unsigned int sampling_rate;79 unsigned int sampling_down_factor;80 unsigned int up_threshold;81+ unsigned int ignore_nice;82};8384static struct dbs_tuners dbs_tuners_ins = {85 .up_threshold = DEF_FREQUENCY_UP_THRESHOLD,086 .sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR,87};88+89+static inline unsigned int get_cpu_idle_time(unsigned int cpu)90+{91+ return kstat_cpu(cpu).cpustat.idle +92+ kstat_cpu(cpu).cpustat.iowait +93+ ( !dbs_tuners_ins.ignore_nice ? 94+ kstat_cpu(cpu).cpustat.nice :95+ 0);96+}9798/************************** sysfs interface ************************/99static ssize_t show_sampling_rate_max(struct cpufreq_policy *policy, char *buf)···115show_one(sampling_rate, sampling_rate);116show_one(sampling_down_factor, sampling_down_factor);117show_one(up_threshold, up_threshold);118+show_one(ignore_nice, ignore_nice);119120static ssize_t store_sampling_down_factor(struct cpufreq_policy *unused, 121 const char *buf, size_t count)···124 int ret;125 ret = sscanf (buf, "%u", &input);126 if (ret != 1 )127+ return -EINVAL;128+129+ if (input > MAX_SAMPLING_DOWN_FACTOR || input < 1)130 return -EINVAL;131132 down(&dbs_sem);···161162 down(&dbs_sem);163 if (ret != 1 || input > MAX_FREQUENCY_UP_THRESHOLD || 164+ input < MIN_FREQUENCY_UP_THRESHOLD) {0165 up(&dbs_sem);166 return -EINVAL;167 }···173 return count;174}175176+static ssize_t store_ignore_nice(struct cpufreq_policy *policy,177 const char *buf, size_t count)178{179 unsigned int input;180 int ret;181+182+ unsigned int j;183+184 ret = sscanf (buf, "%u", &input);185+ if ( ret != 1 )00000186 return -EINVAL;0187188+ if ( input > 1 )189+ input = 1;190+191+ down(&dbs_sem);192+ if ( input == dbs_tuners_ins.ignore_nice ) { /* nothing to do */193+ up(&dbs_sem);194+ return count;195+ }196+ dbs_tuners_ins.ignore_nice = input;197+198+ /* we need to re-evaluate prev_cpu_idle_up and prev_cpu_idle_down */199+ for_each_online_cpu(j) {200+ struct cpu_dbs_info_s *j_dbs_info;201+ j_dbs_info = &per_cpu(cpu_dbs_info, j);202+ j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);203+ j_dbs_info->prev_cpu_idle_down = j_dbs_info->prev_cpu_idle_up;204+ }205 up(&dbs_sem);206207 return count;···201define_one_rw(sampling_rate);202define_one_rw(sampling_down_factor);203define_one_rw(up_threshold);204+define_one_rw(ignore_nice);205206static struct attribute * dbs_attributes[] = {207 &sampling_rate_max.attr,···209 &sampling_rate.attr,210 &sampling_down_factor.attr,211 &up_threshold.attr,212+ &ignore_nice.attr,213 NULL214};215···222223static void dbs_check_cpu(int cpu)224{225+ unsigned int idle_ticks, up_idle_ticks, total_ticks;226+ unsigned int freq_next;0227 unsigned int freq_down_sampling_rate;228 static int down_skip[NR_CPUS];229 struct cpu_dbs_info_s *this_dbs_info;···238239 policy = this_dbs_info->cur_policy;240 /* 241+ * Every sampling_rate, we check, if current idle time is less242+ * than 20% (default), then we try to increase frequency243+ * Every sampling_rate*sampling_down_factor, we look for a the lowest244+ * frequency which can sustain the load while keeping idle time over245+ * 30%. If such a frequency exist, we try to decrease to this frequency.00246 *247 * Any frequency increase takes it to the maximum frequency. 248 * Frequency reduction happens at minimum steps of 249+ * 5% (default) of current frequency 250 */251252 /* Check for frequency increase */253+ idle_ticks = UINT_MAX;000000254 for_each_cpu_mask(j, policy->cpus) {255+ unsigned int tmp_idle_ticks, total_idle_ticks;256 struct cpu_dbs_info_s *j_dbs_info;257000258 j_dbs_info = &per_cpu(cpu_dbs_info, j);259+ total_idle_ticks = get_cpu_idle_time(j);00260 tmp_idle_ticks = total_idle_ticks -261 j_dbs_info->prev_cpu_idle_up;262 j_dbs_info->prev_cpu_idle_up = total_idle_ticks;···281 /* Scale idle ticks by 100 and compare with up and down ticks */282 idle_ticks *= 100;283 up_idle_ticks = (100 - dbs_tuners_ins.up_threshold) *284+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate);285286 if (idle_ticks < up_idle_ticks) {287+ down_skip[cpu] = 0;288+ for_each_cpu_mask(j, policy->cpus) {289+ struct cpu_dbs_info_s *j_dbs_info;290+291+ j_dbs_info = &per_cpu(cpu_dbs_info, j);292+ j_dbs_info->prev_cpu_idle_down = 293+ j_dbs_info->prev_cpu_idle_up;294+ }295+ /* if we are already at full speed then break out early */296+ if (policy->cur == policy->max)297+ return;298+299 __cpufreq_driver_target(policy, policy->max, 300 CPUFREQ_RELATION_H);00301 return;302 }303···296 if (down_skip[cpu] < dbs_tuners_ins.sampling_down_factor)297 return;298299+ idle_ticks = UINT_MAX;00000300 for_each_cpu_mask(j, policy->cpus) {301+ unsigned int tmp_idle_ticks, total_idle_ticks;302 struct cpu_dbs_info_s *j_dbs_info;303000304 j_dbs_info = &per_cpu(cpu_dbs_info, j);305+ /* Check for frequency decrease */306+ total_idle_ticks = j_dbs_info->prev_cpu_idle_up;0307 tmp_idle_ticks = total_idle_ticks -308 j_dbs_info->prev_cpu_idle_down;309 j_dbs_info->prev_cpu_idle_down = total_idle_ticks;···321 idle_ticks = tmp_idle_ticks;322 }32300324 down_skip[cpu] = 0;325+ /* if we cannot reduce the frequency anymore, break out early */326+ if (policy->cur == policy->min)327+ return;328329+ /* Compute how many ticks there are between two measurements */330 freq_down_sampling_rate = dbs_tuners_ins.sampling_rate *331 dbs_tuners_ins.sampling_down_factor;332+ total_ticks = usecs_to_jiffies(freq_down_sampling_rate);0333334+ /*335+ * The optimal frequency is the frequency that is the lowest that336+ * can support the current CPU usage without triggering the up337+ * policy. To be safe, we focus 10 points under the threshold.338+ */339+ freq_next = ((total_ticks - idle_ticks) * 100) / total_ticks;340+ freq_next = (freq_next * policy->cur) / 341+ (dbs_tuners_ins.up_threshold - 10);342343+ if (freq_next <= ((policy->cur * 95) / 100))344+ __cpufreq_driver_target(policy, freq_next, CPUFREQ_RELATION_L);0000000345}346347static void do_dbs_timer(void *data)348{ 349 int i;350 down(&dbs_sem);351+ for_each_online_cpu(i)352+ dbs_check_cpu(i);0353 schedule_delayed_work(&dbs_work, 354+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));355 up(&dbs_sem);356} 357···360{361 INIT_WORK(&dbs_work, do_dbs_timer, NULL);362 schedule_delayed_work(&dbs_work,363+ usecs_to_jiffies(dbs_tuners_ins.sampling_rate));364 return;365}366···397 j_dbs_info = &per_cpu(cpu_dbs_info, j);398 j_dbs_info->cur_policy = policy;399400+ j_dbs_info->prev_cpu_idle_up = get_cpu_idle_time(j);401+ j_dbs_info->prev_cpu_idle_down402+ = j_dbs_info->prev_cpu_idle_up;000403 }404 this_dbs_info->enable = 1;405 sysfs_create_group(&policy->kobj, &dbs_attr_group);···422 def_sampling_rate = (latency / 1000) *423 DEF_SAMPLING_RATE_LATENCY_MULTIPLIER;424 dbs_tuners_ins.sampling_rate = def_sampling_rate;425+ dbs_tuners_ins.ignore_nice = 0;426427 dbs_timer_init();428 }···461 return 0;462}463464+static struct cpufreq_governor cpufreq_gov_dbs = {465 .name = "ondemand",466 .governor = cpufreq_governor_dbs,467 .owner = THIS_MODULE,468};0469470static int __init cpufreq_gov_dbs_init(void)471{
+30-17
drivers/cpufreq/cpufreq_stats.c
···19#include <linux/percpu.h>20#include <linux/kobject.h>21#include <linux/spinlock.h>02223static spinlock_t cpufreq_stats_lock;24···30 .show = _show,\31};3233-static unsigned long34-delta_time(unsigned long old, unsigned long new)35-{36- return (old > new) ? (old - new): (new + ~old + 1);37-}38-39struct cpufreq_stats {40 unsigned int cpu;41 unsigned int total_trans;42- unsigned long long last_time;43 unsigned int max_state;44 unsigned int state_num;45 unsigned int last_index;46- unsigned long long *time_in_state;47 unsigned int *freq_table;48#ifdef CONFIG_CPU_FREQ_STAT_DETAILS49 unsigned int *trans_table;···55cpufreq_stats_update (unsigned int cpu)56{57 struct cpufreq_stats *stat;00058 spin_lock(&cpufreq_stats_lock);59 stat = cpufreq_stats_table[cpu];60 if (stat->time_in_state)61- stat->time_in_state[stat->last_index] +=62- delta_time(stat->last_time, jiffies);63- stat->last_time = jiffies;064 spin_unlock(&cpufreq_stats_lock);65 return 0;66}···89 return 0;90 cpufreq_stats_update(stat->cpu);91 for (i = 0; i < stat->state_num; i++) {92- len += sprintf(buf + len, "%u %llu\n",93- stat->freq_table[i], stat->time_in_state[i]);94 }95 return len;96}···106 if(!stat)107 return 0;108 cpufreq_stats_update(stat->cpu);00109 for (i = 0; i < stat->state_num; i++) {110 if (len >= PAGE_SIZE)111 break;112- len += snprintf(buf + len, PAGE_SIZE - len, "%9u:\t",000000000000113 stat->freq_table[i]);114115 for (j = 0; j < stat->state_num; j++) {116 if (len >= PAGE_SIZE)117 break;118- len += snprintf(buf + len, PAGE_SIZE - len, "%u\t",119 stat->trans_table[i*stat->max_state+j]);120 }121 len += snprintf(buf + len, PAGE_SIZE - len, "\n");···210 count++;211 }212213- alloc_size = count * sizeof(int) + count * sizeof(long long);214215#ifdef CONFIG_CPU_FREQ_STAT_DETAILS216 alloc_size += count * count * sizeof(int);···237 }238 stat->state_num = j;239 spin_lock(&cpufreq_stats_lock);240- stat->last_time = jiffies;241 stat->last_index = freq_table_get_index(stat, policy->cur);242 spin_unlock(&cpufreq_stats_lock);243 cpufreq_cpu_put(data);
···19#include <linux/percpu.h>20#include <linux/kobject.h>21#include <linux/spinlock.h>22+#include <asm/cputime.h>2324static spinlock_t cpufreq_stats_lock;25···29 .show = _show,\30};3100000032struct cpufreq_stats {33 unsigned int cpu;34 unsigned int total_trans;35+ unsigned long long last_time;36 unsigned int max_state;37 unsigned int state_num;38 unsigned int last_index;39+ cputime64_t *time_in_state;40 unsigned int *freq_table;41#ifdef CONFIG_CPU_FREQ_STAT_DETAILS42 unsigned int *trans_table;···60cpufreq_stats_update (unsigned int cpu)61{62 struct cpufreq_stats *stat;63+ unsigned long long cur_time;64+65+ cur_time = get_jiffies_64();66 spin_lock(&cpufreq_stats_lock);67 stat = cpufreq_stats_table[cpu];68 if (stat->time_in_state)69+ stat->time_in_state[stat->last_index] =70+ cputime64_add(stat->time_in_state[stat->last_index],71+ cputime_sub(cur_time, stat->last_time));72+ stat->last_time = cur_time;73 spin_unlock(&cpufreq_stats_lock);74 return 0;75}···90 return 0;91 cpufreq_stats_update(stat->cpu);92 for (i = 0; i < stat->state_num; i++) {93+ len += sprintf(buf + len, "%u %llu\n", stat->freq_table[i], 94+ (unsigned long long)cputime64_to_clock_t(stat->time_in_state[i]));95 }96 return len;97}···107 if(!stat)108 return 0;109 cpufreq_stats_update(stat->cpu);110+ len += snprintf(buf + len, PAGE_SIZE - len, " From : To\n");111+ len += snprintf(buf + len, PAGE_SIZE - len, " : ");112 for (i = 0; i < stat->state_num; i++) {113 if (len >= PAGE_SIZE)114 break;115+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",116+ stat->freq_table[i]);117+ }118+ if (len >= PAGE_SIZE)119+ return len;120+121+ len += snprintf(buf + len, PAGE_SIZE - len, "\n");122+123+ for (i = 0; i < stat->state_num; i++) {124+ if (len >= PAGE_SIZE)125+ break;126+127+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u: ",128 stat->freq_table[i]);129130 for (j = 0; j < stat->state_num; j++) {131 if (len >= PAGE_SIZE)132 break;133+ len += snprintf(buf + len, PAGE_SIZE - len, "%9u ",134 stat->trans_table[i*stat->max_state+j]);135 }136 len += snprintf(buf + len, PAGE_SIZE - len, "\n");···197 count++;198 }199200+ alloc_size = count * sizeof(int) + count * sizeof(cputime64_t);201202#ifdef CONFIG_CPU_FREQ_STAT_DETAILS203 alloc_size += count * count * sizeof(int);···224 }225 stat->state_num = j;226 spin_lock(&cpufreq_stats_lock);227+ stat->last_time = get_jiffies_64();228 stat->last_index = freq_table_get_index(stat, policy->cur);229 spin_unlock(&cpufreq_stats_lock);230 cpufreq_cpu_put(data);
+1
drivers/firmware/pcdp.c
···11 * published by the Free Software Foundation.12 */13014#include <linux/acpi.h>15#include <linux/console.h>16#include <linux/efi.h>
···11 * published by the Free Software Foundation.12 */1314+#include <linux/config.h>15#include <linux/acpi.h>16#include <linux/console.h>17#include <linux/efi.h>
+31-15
drivers/i2c/busses/i2c-ali1563.c
···2 * i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge3 *4 * Copyright (C) 2004 Patrick Mochel05 *6 * The 1563 southbridge is deceptively similar to the 1533, with a7 * few notable exceptions. One of those happens to be the fact they···58#define HST_CNTL2_BLOCK 0x05596006162static unsigned short ali1563_smba;6364-static int ali1563_transaction(struct i2c_adapter * a)65{66 u32 data;67 int timeout;···7576 data = inb_p(SMB_HST_STS);77 if (data & HST_STS_BAD) {78- dev_warn(&a->dev,"ali1563: Trying to reset busy device\n");79 outb_p(data | HST_STS_BAD,SMB_HST_STS);80 data = inb_p(SMB_HST_STS);81 if (data & HST_STS_BAD)···9697 if (timeout && !(data & HST_STS_BAD))98 return 0;99- dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n",100- timeout ? "Timeout " : "",101- data & HST_STS_FAIL ? "Transaction Failed " : "",102- data & HST_STS_BUSERR ? "No response or Bus Collision " : "",103- data & HST_STS_DEVERR ? "Device Error " : "",104- !(data & HST_STS_DONE) ? "Transaction Never Finished " : "");105106- if (!(data & HST_STS_DONE))0107 /* Issue 'kill' to host controller */108 outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2);109- else110- /* Issue timeout to reset all devices on bus */0000000000111 outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1);0000000112 return -1;113}114···163164 if (timeout && !(data & HST_STS_BAD))165 return 0;166- dev_warn(&a->dev, "SMBus Error: %s%s%s%s%s\n",167 timeout ? "Timeout " : "",168 data & HST_STS_FAIL ? "Transaction Failed " : "",169 data & HST_STS_BUSERR ? "No response or Bus Collision " : "",···256 }257258 outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD);259- outb_p(inb_p(SMB_HST_CNTL2) | (size << 3), SMB_HST_CNTL2);260261 /* Write the command register */0262 switch(size) {263 case HST_CNTL2_BYTE:264 if (rw== I2C_SMBUS_WRITE)265- outb_p(cmd, SMB_HST_CMD);0266 break;267 case HST_CNTL2_BYTE_DATA:268 outb_p(cmd, SMB_HST_CMD);···284 goto Done;285 }286287- if ((error = ali1563_transaction(a)))288 goto Done;289290 if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK))
···2 * i2c-ali1563.c - i2c driver for the ALi 1563 Southbridge3 *4 * Copyright (C) 2004 Patrick Mochel5+ * 2005 Rudolf Marek <r.marek@sh.cvut.cz>6 *7 * The 1563 southbridge is deceptively similar to the 1533, with a8 * few notable exceptions. One of those happens to be the fact they···57#define HST_CNTL2_BLOCK 0x05585960+#define HST_CNTL2_SIZEMASK 0x386162static unsigned short ali1563_smba;6364+static int ali1563_transaction(struct i2c_adapter * a, int size)65{66 u32 data;67 int timeout;···7374 data = inb_p(SMB_HST_STS);75 if (data & HST_STS_BAD) {76+ dev_err(&a->dev, "ali1563: Trying to reset busy device\n");77 outb_p(data | HST_STS_BAD,SMB_HST_STS);78 data = inb_p(SMB_HST_STS);79 if (data & HST_STS_BAD)···9495 if (timeout && !(data & HST_STS_BAD))96 return 0;0000009798+ if (!timeout) {99+ dev_err(&a->dev, "Timeout - Trying to KILL transaction!\n");100 /* Issue 'kill' to host controller */101 outb_p(HST_CNTL2_KILL,SMB_HST_CNTL2);102+ data = inb_p(SMB_HST_STS);103+ }104+105+ /* device error - no response, ignore the autodetection case */106+ if ((data & HST_STS_DEVERR) && (size != HST_CNTL2_QUICK)) {107+ dev_err(&a->dev, "Device error!\n");108+ }109+110+ /* bus collision */111+ if (data & HST_STS_BUSERR) {112+ dev_err(&a->dev, "Bus collision!\n");113+ /* Issue timeout, hoping it helps */114 outb_p(HST_CNTL1_TIMEOUT,SMB_HST_CNTL1);115+ }116+117+ if (data & HST_STS_FAIL) {118+ dev_err(&a->dev, "Cleaning fail after KILL!\n");119+ outb_p(0x0,SMB_HST_CNTL2);120+ }121+122 return -1;123}124···149150 if (timeout && !(data & HST_STS_BAD))151 return 0;152+ dev_err(&a->dev, "SMBus Error: %s%s%s%s%s\n",153 timeout ? "Timeout " : "",154 data & HST_STS_FAIL ? "Transaction Failed " : "",155 data & HST_STS_BUSERR ? "No response or Bus Collision " : "",···242 }243244 outb_p(((addr & 0x7f) << 1) | (rw & 0x01), SMB_HST_ADD);245+ outb_p((inb_p(SMB_HST_CNTL2) & ~HST_CNTL2_SIZEMASK) | (size << 3), SMB_HST_CNTL2);246247 /* Write the command register */248+249 switch(size) {250 case HST_CNTL2_BYTE:251 if (rw== I2C_SMBUS_WRITE)252+ /* Beware it uses DAT0 register and not CMD! */253+ outb_p(cmd, SMB_HST_DAT0);254 break;255 case HST_CNTL2_BYTE_DATA:256 outb_p(cmd, SMB_HST_CMD);···268 goto Done;269 }270271+ if ((error = ali1563_transaction(a, size)))272 goto Done;273274 if ((rw == I2C_SMBUS_WRITE) || (size == HST_CNTL2_QUICK))
+1-1
drivers/ide/ide-cd.c
···1936 * NOTE! The "len" and "addr" checks should possibly have1937 * separate masks.1938 */1939- if ((rq->data_len & mask) || (addr & mask))1940 info->dma = 0;1941 }1942
···1936 * NOTE! The "len" and "addr" checks should possibly have1937 * separate masks.1938 */1939+ if ((rq->data_len & 15) || (addr & mask))1940 info->dma = 0;1941 }1942
···68 depends on PCI6970endif71-72-# Yes, SOUND_GAMEPORT looks a bit odd. Yes, it ends up being turned on73-# in every .config. Please don't touch it. It is here to handle an74-# unusual dependency between GAMEPORT and sound drivers.75-#76-# Some sound drivers call gameport functions. If GAMEPORT is77-# not selected, empty stubs are provided for the functions and all is78-# well.79-# If GAMEPORT is built in, everything is fine.80-# If GAMEPORT is a module, however, it would need to be loaded for the81-# sound driver to be able to link properly. Therefore, the sound82-# driver must be a module as well in that case. Since there's no way83-# to express that directly in Kconfig, we use SOUND_GAMEPORT to84-# express it. SOUND_GAMEPORT boils down to "if GAMEPORT is 'm',85-# anything that depends on SOUND_GAMEPORT must be 'm' as well. if86-# GAMEPORT is 'y' or 'n', it can be anything".87-config SOUND_GAMEPORT88- tristate89- default m if GAMEPORT=m90- default y
···518/*519 * First, we check if it's a mouse. It should send 0x00 or 0x03520 * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.00521 */522523 param[0] = 0xa5;524 if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))525 return -1;526527- if (param[0] != 0x00 && param[0] != 0x03 && param[0] != 0x04)0528 return -1;529530/*···975 return -EINVAL;976977 if (!strncmp(val, "any", 3)) {978- *((unsigned int *)kp->arg) = -1UL;979 return 0;980 }981
···518/*519 * First, we check if it's a mouse. It should send 0x00 or 0x03520 * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.521+ * Sunrex K8561 IR Keyboard/Mouse reports 0xff on second and subsequent522+ * ID queries, probably due to a firmware bug.523 */524525 param[0] = 0xa5;526 if (ps2_command(ps2dev, param, PSMOUSE_CMD_GETID))527 return -1;528529+ if (param[0] != 0x00 && param[0] != 0x03 &&530+ param[0] != 0x04 && param[0] != 0xff)531 return -1;532533/*···972 return -EINVAL;973974 if (!strncmp(val, "any", 3)) {975+ *((unsigned int *)kp->arg) = -1U;976 return 0;977 }978
+5-34
drivers/input/mouse/synaptics.c
···143 return -1;144}145146-static void print_ident(struct synaptics_data *priv)147-{148- printk(KERN_INFO "Synaptics Touchpad, model: %ld\n", SYN_ID_MODEL(priv->identity));149- printk(KERN_INFO " Firmware: %ld.%ld\n", SYN_ID_MAJOR(priv->identity),150- SYN_ID_MINOR(priv->identity));151- if (SYN_MODEL_ROT180(priv->model_id))152- printk(KERN_INFO " 180 degree mounted touchpad\n");153- if (SYN_MODEL_PORTRAIT(priv->model_id))154- printk(KERN_INFO " portrait touchpad\n");155- printk(KERN_INFO " Sensor: %ld\n", SYN_MODEL_SENSOR(priv->model_id));156- if (SYN_MODEL_NEWABS(priv->model_id))157- printk(KERN_INFO " new absolute packet format\n");158- if (SYN_MODEL_PEN(priv->model_id))159- printk(KERN_INFO " pen detection\n");160-161- if (SYN_CAP_EXTENDED(priv->capabilities)) {162- printk(KERN_INFO " Touchpad has extended capability bits\n");163- if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))164- printk(KERN_INFO " -> %d multi-buttons, i.e. besides standard buttons\n",165- (int)(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)));166- if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))167- printk(KERN_INFO " -> middle button\n");168- if (SYN_CAP_FOUR_BUTTON(priv->capabilities))169- printk(KERN_INFO " -> four buttons\n");170- if (SYN_CAP_MULTIFINGER(priv->capabilities))171- printk(KERN_INFO " -> multifinger detection\n");172- if (SYN_CAP_PALMDETECT(priv->capabilities))173- printk(KERN_INFO " -> palm detection\n");174- if (SYN_CAP_PASS_THROUGH(priv->capabilities))175- printk(KERN_INFO " -> pass-through port\n");176- }177-}178-179static int synaptics_query_hardware(struct psmouse *psmouse)180{181 int retries = 0;···633634 priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS;635636- print_ident(priv);0000637 set_input_params(&psmouse->dev, priv);638639 psmouse->protocol_handler = synaptics_process_byte;
···3666 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);3667}366800000003669/**3670 * ata_host_remove - Unregister SCSI host structure with upper layers3671 * @ap: Port to unregister···4278 }42794280 free_irq(host_set->irq, host_set);4281- if (host_set->ops->host_stop)4282- host_set->ops->host_stop(host_set);4283- if (host_set->mmio_base)4284- iounmap(host_set->mmio_base);42854286 for (i = 0; i < host_set->n_ports; i++) {4287 ap = host_set->ports[i];···42954296 scsi_host_put(ap->host);4297 }00042984299 kfree(host_set);4300···4387EXPORT_SYMBOL_GPL(ata_exec_command);4388EXPORT_SYMBOL_GPL(ata_port_start);4389EXPORT_SYMBOL_GPL(ata_port_stop);04390EXPORT_SYMBOL_GPL(ata_interrupt);4391EXPORT_SYMBOL_GPL(ata_qc_prep);4392EXPORT_SYMBOL_GPL(ata_bmdma_setup);
···3666 dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);3667}36683669+void ata_host_stop (struct ata_host_set *host_set)3670+{3671+ if (host_set->mmio_base)3672+ iounmap(host_set->mmio_base);3673+}3674+3675+3676/**3677 * ata_host_remove - Unregister SCSI host structure with upper layers3678 * @ap: Port to unregister···4271 }42724273 free_irq(host_set->irq, host_set);000042744275 for (i = 0; i < host_set->n_ports; i++) {4276 ap = host_set->ports[i];···42924293 scsi_host_put(ap->host);4294 }4295+4296+ if (host_set->ops->host_stop)4297+ host_set->ops->host_stop(host_set);42984299 kfree(host_set);4300···4381EXPORT_SYMBOL_GPL(ata_exec_command);4382EXPORT_SYMBOL_GPL(ata_port_start);4383EXPORT_SYMBOL_GPL(ata_port_stop);4384+EXPORT_SYMBOL_GPL(ata_host_stop);4385EXPORT_SYMBOL_GPL(ata_interrupt);4386EXPORT_SYMBOL_GPL(ata_qc_prep);4387EXPORT_SYMBOL_GPL(ata_bmdma_setup);
+1-1
drivers/scsi/libata.h
···26#define __LIBATA_H__2728#define DRV_NAME "libata"29-#define DRV_VERSION "1.10" /* must be exactly four chars */3031struct ata_scsi_args {32 u16 *id;
···26#define __LIBATA_H__2728#define DRV_NAME "libata"29+#define DRV_VERSION "1.11" /* must be exactly four chars */3031struct ata_scsi_args {32 u16 *id;
···124 To compile this driver as a module, choose M here: the125 module will be called sl811-hcd.12600000000000
···124 To compile this driver as a module, choose M here: the125 module will be called sl811-hcd.126127+config USB_SL811_CS128+ tristate "CF/PCMCIA support for SL811HS HCD"129+ depends on USB_SL811_HCD && PCMCIA130+ default N131+ help132+ Wraps a PCMCIA driver around the SL811HS HCD, supporting the RATOC133+ REX-CFU1U CF card (often used with PDAs). If unsure, say N.134+135+ To compile this driver as a module, choose M here: the136+ module will be called "sl811_cs".137+
···144145/* ELV USB Module UO100 (PID sent by Stefan Frings) */146#define FTDI_ELV_UO100_PID 0xFB58 /* Product Id */00147148/*149 * Definitions for ID TECH (www.idt-net.com) devices
···144145/* ELV USB Module UO100 (PID sent by Stefan Frings) */146#define FTDI_ELV_UO100_PID 0xFB58 /* Product Id */147+/* ELV USB Module UM100 (PID sent by Arnim Laeuger) */148+#define FTDI_ELV_UM100_PID 0xFB5A /* Product Id */149150/*151 * Definitions for ID TECH (www.idt-net.com) devices
+10-10
drivers/usb/serial/usb-serial.c
···1297 goto exit_bus;1298 }12991300- /* register the generic driver, if we should */1301- result = usb_serial_generic_register(debug);1302- if (result < 0) {1303- err("%s - registering generic driver failed", __FUNCTION__);1304- goto exit_generic;1305- }1306-1307 usb_serial_tty_driver->owner = THIS_MODULE;1308 usb_serial_tty_driver->driver_name = "usbserial";1309 usb_serial_tty_driver->devfs_name = "usb/tts/";···1322 goto exit_tty;1323 }132400000001325 info(DRIVER_DESC " " DRIVER_VERSION);13261327 return result;00013281329exit_tty:1330 tty_unregister_driver(usb_serial_tty_driver);13311332exit_reg_driver:1333- usb_serial_generic_deregister();1334-1335-exit_generic:1336 bus_unregister(&usb_serial_bus_type);13371338exit_bus:
···1297 goto exit_bus;1298 }129900000001300 usb_serial_tty_driver->owner = THIS_MODULE;1301 usb_serial_tty_driver->driver_name = "usbserial";1302 usb_serial_tty_driver->devfs_name = "usb/tts/";···1329 goto exit_tty;1330 }13311332+ /* register the generic driver, if we should */1333+ result = usb_serial_generic_register(debug);1334+ if (result < 0) {1335+ err("%s - registering generic driver failed", __FUNCTION__);1336+ goto exit_generic;1337+ }1338+1339 info(DRIVER_DESC " " DRIVER_VERSION);13401341 return result;1342+1343+exit_generic:1344+ usb_deregister(&usb_serial_driver);13451346exit_tty:1347 tty_unregister_driver(usb_serial_tty_driver);13481349exit_reg_driver:0001350 bus_unregister(&usb_serial_bus_type);13511352exit_bus:
+11-11
drivers/video/intelfb/intelfbdrv.c
···228MODULE_LICENSE("Dual BSD/GPL");229MODULE_DEVICE_TABLE(pci, intelfb_pci_table);230231-static int accel __initdata = 1;232-static int vram __initdata = 4;233-static int hwcursor __initdata = 1;234-static int mtrr __initdata = 1;235-static int fixed __initdata = 0;236-static int noinit __initdata = 0;237-static int noregister __initdata = 0;238-static int probeonly __initdata = 0;239-static int idonly __initdata = 0;240-static int bailearly __initdata = 0;241-static char *mode __initdata = NULL;242243module_param(accel, bool, S_IRUGO);244MODULE_PARM_DESC(accel, "Enable console acceleration");
···228MODULE_LICENSE("Dual BSD/GPL");229MODULE_DEVICE_TABLE(pci, intelfb_pci_table);230231+static int accel = 1;232+static int vram = 4;233+static int hwcursor = 1;234+static int mtrr = 1;235+static int fixed = 0;236+static int noinit = 0;237+static int noregister = 0;238+static int probeonly = 0;239+static int idonly = 0;240+static int bailearly = 0;241+static char *mode = NULL;242243module_param(accel, bool, S_IRUGO);244MODULE_PARM_DESC(accel, "Enable console acceleration");
+2-2
fs/cifs/README
···371 on newly created files, directories, and devices (create, 372 mkdir, mknod) which will result in the server setting the373 uid and gid to the default (usually the server uid of the374- usern who mounted the share). Letting the server (rather than375 the client) set the uid and gid is the default. This376 parameter has no effect if the CIFS Unix Extensions are not377 negotiated.···384 client (e.g. when the application is doing large sequential385 reads bigger than page size without rereading the same data) 386 this can provide better performance than the default387- behavior which caches reads (reaadahead) and writes 388 (writebehind) through the local Linux client pagecache 389 if oplock (caching token) is granted and held. Note that390 direct allows write operations larger than page size
···371 on newly created files, directories, and devices (create, 372 mkdir, mknod) which will result in the server setting the373 uid and gid to the default (usually the server uid of the374+ user who mounted the share). Letting the server (rather than375 the client) set the uid and gid is the default. This376 parameter has no effect if the CIFS Unix Extensions are not377 negotiated.···384 client (e.g. when the application is doing large sequential385 reads bigger than page size without rereading the same data) 386 this can provide better performance than the default387+ behavior which caches reads (readahead) and writes 388 (writebehind) through the local Linux client pagecache 389 if oplock (caching token) is granted and held. Note that390 direct allows write operations larger than page size
+1-1
fs/cifs/cifsproto.h
···228 const struct nls_table *nls_codepage, 229 int remap_special_chars);230#endif /* CONFIG_CIFS_EXPERIMENTAL */231-extern int cifs_convertUCSpath(char *target, const __u16 *source, int maxlen,232 const struct nls_table * codepage);233extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen,234 const struct nls_table * cp, int mapChars);
···228 const struct nls_table *nls_codepage, 229 int remap_special_chars);230#endif /* CONFIG_CIFS_EXPERIMENTAL */231+extern int cifs_convertUCSpath(char *target, const __le16 *source, int maxlen,232 const struct nls_table * codepage);233extern int cifsConvertToUCS(__le16 * target, const char *source, int maxlen,234 const struct nls_table * cp, int mapChars);
···392 rc = 0;393 d_add(direntry, NULL);394 } else {395- cERROR(1,("Error 0x%x or on cifs_get_inode_info in lookup",rc));0396 /* BB special case check for Access Denied - watch security 397 exposure of returning dir info implicitly via different rc 398 if file exists or not but no access BB */
···392 rc = 0;393 d_add(direntry, NULL);394 } else {395+ cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s",396+ rc,full_path));397 /* BB special case check for Access Denied - watch security 398 exposure of returning dir info implicitly via different rc 399 if file exists or not but no access BB */
+15-9
fs/cifs/inode.c
···422 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);423424 if (!rc) {425- direntry->d_inode->i_nlink--;0426 } else if (rc == -ENOENT) {427 d_drop(direntry);428 } else if (rc == -ETXTBSY) {···441 cifs_sb->mnt_cifs_flags & 442 CIFS_MOUNT_MAP_SPECIAL_CHR);443 CIFSSMBClose(xid, pTcon, netfid);444- direntry->d_inode->i_nlink--;0445 }446 } else if (rc == -EACCES) {447 /* try only if r/o attribute set in local lookup data? */···496 cifs_sb->mnt_cifs_flags & 497 CIFS_MOUNT_MAP_SPECIAL_CHR);498 if (!rc) {499- direntry->d_inode->i_nlink--;0500 } else if (rc == -ETXTBSY) {501 int oplock = FALSE;502 __u16 netfid;···517 cifs_sb->mnt_cifs_flags &518 CIFS_MOUNT_MAP_SPECIAL_CHR);519 CIFSSMBClose(xid, pTcon, netfid);520- direntry->d_inode->i_nlink--;0521 }522 /* BB if rc = -ETXTBUSY goto the rename logic BB */523 }524 }525 }526- cifsInode = CIFS_I(direntry->d_inode);527- cifsInode->time = 0; /* will force revalidate to get info when528- needed */529- direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime =530- current_fs_time(inode->i_sb);00531 cifsInode = CIFS_I(inode);532 cifsInode->time = 0; /* force revalidate of dir as well */533
···422 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);423424 if (!rc) {425+ if(direntry->d_inode)426+ direntry->d_inode->i_nlink--;427 } else if (rc == -ENOENT) {428 d_drop(direntry);429 } else if (rc == -ETXTBSY) {···440 cifs_sb->mnt_cifs_flags & 441 CIFS_MOUNT_MAP_SPECIAL_CHR);442 CIFSSMBClose(xid, pTcon, netfid);443+ if(direntry->d_inode)444+ direntry->d_inode->i_nlink--;445 }446 } else if (rc == -EACCES) {447 /* try only if r/o attribute set in local lookup data? */···494 cifs_sb->mnt_cifs_flags & 495 CIFS_MOUNT_MAP_SPECIAL_CHR);496 if (!rc) {497+ if(direntry->d_inode)498+ direntry->d_inode->i_nlink--;499 } else if (rc == -ETXTBSY) {500 int oplock = FALSE;501 __u16 netfid;···514 cifs_sb->mnt_cifs_flags &515 CIFS_MOUNT_MAP_SPECIAL_CHR);516 CIFSSMBClose(xid, pTcon, netfid);517+ if(direntry->d_inode)518+ direntry->d_inode->i_nlink--;519 }520 /* BB if rc = -ETXTBUSY goto the rename logic BB */521 }522 }523 }524+ if(direntry->d_inode) {525+ cifsInode = CIFS_I(direntry->d_inode);526+ cifsInode->time = 0; /* will force revalidate to get info527+ when needed */528+ direntry->d_inode->i_ctime = current_fs_time(inode->i_sb);529+ }530+ inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb);531 cifsInode = CIFS_I(inode);532 cifsInode->time = 0; /* force revalidate of dir as well */533
+1
fs/cifs/misc.c
···571 break;572 case UNI_LESSTHAN:573 target[j] = '<';0574 default: 575 len = cp->uni2char(src_char, &target[j], 576 NLS_MAX_CHARSET_SIZE);
···571 break;572 case UNI_LESSTHAN:573 target[j] = '<';574+ break;575 default: 576 len = cp->uni2char(src_char, &target[j], 577 NLS_MAX_CHARSET_SIZE);
···12#include <asm/uaccess.h>1314#ifndef HAVE_ARCH_DEVTREE_FIXUPS15-static inline void set_node_proc_entry(struct device_node *np, struct proc_dir_entry *de)16-{17-}18-19-static void inline set_node_name_link(struct device_node *np, struct proc_dir_entry *de)20-{21-}22-23-static void inline set_node_addr_link(struct device_node *np, struct proc_dir_entry *de)24{25}26#endif···51/*52 * Process a node, adding entries for its children and its properties.53 */54-void proc_device_tree_add_node(struct device_node *np, struct proc_dir_entry *de)055{56 struct property *pp;57 struct proc_dir_entry *ent;58- struct device_node *child, *sib;59- const char *p, *at;60- int l;61- struct proc_dir_entry *list, **lastp, *al;6263 set_node_proc_entry(np, de);64 lastp = &list;00000000000000065 for (pp = np->properties; pp != 0; pp = pp->next) {000000000000000066 /*67 * Unfortunately proc_register puts each new entry68 * at the beginning of the list. So we rearrange them.69 */70- ent = create_proc_read_entry(pp->name, strncmp(pp->name, "security-", 9) ?71- S_IRUGO : S_IRUSR, de, property_read_proc, pp);0072 if (ent == 0)73 break;74 if (!strncmp(pp->name, "security-", 9))75 ent->size = 0; /* don't leak number of password chars */76 else77 ent->size = pp->length;078 *lastp = ent;79 lastp = &ent->next;80 }81- child = NULL;82- while ((child = of_get_next_child(np, child))) {83- p = strrchr(child->full_name, '/');84- if (!p)85- p = child->full_name;86- else87- ++p;88- /* chop off '@0' if the name ends with that */89- l = strlen(p);90- if (l > 2 && p[l-2] == '@' && p[l-1] == '0')91- l -= 2;92- ent = proc_mkdir(p, de);93- if (ent == 0)94- break;95- *lastp = ent;96- lastp = &ent->next;97- proc_device_tree_add_node(child, ent);98-99- /*100- * If we left the address part on the name, consider101- * adding symlinks from the name and address parts.102- */103- if (p[l] != 0 || (at = strchr(p, '@')) == 0)104- continue;105-106- /*107- * If this is the first node with a given name property,108- * add a symlink with the name property as its name.109- */110- sib = NULL;111- while ((sib = of_get_next_child(np, sib)) && sib != child)112- if (sib->name && strcmp(sib->name, child->name) == 0)113- break;114- if (sib == child && strncmp(p, child->name, l) != 0) {115- al = proc_symlink(child->name, de, ent->name);116- if (al == 0) {117- of_node_put(sib);118- break;119- }120- set_node_name_link(child, al);121- *lastp = al;122- lastp = &al->next;123- }124- of_node_put(sib);125- /*126- * Add another directory with the @address part as its name.127- */128- al = proc_symlink(at, de, ent->name);129- if (al == 0)130- break;131- set_node_addr_link(child, al);132- *lastp = al;133- lastp = &al->next;134- }135- of_node_put(child);136- *lastp = NULL;137 de->subdir = list;138}139
···12#include <asm/uaccess.h>1314#ifndef HAVE_ARCH_DEVTREE_FIXUPS15+static inline void set_node_proc_entry(struct device_node *np,16+ struct proc_dir_entry *de)000000017{18}19#endif···58/*59 * Process a node, adding entries for its children and its properties.60 */61+void proc_device_tree_add_node(struct device_node *np,62+ struct proc_dir_entry *de)63{64 struct property *pp;65 struct proc_dir_entry *ent;66+ struct device_node *child;67+ struct proc_dir_entry *list = NULL, **lastp;68+ const char *p;06970 set_node_proc_entry(np, de);71 lastp = &list;72+ for (child = NULL; (child = of_get_next_child(np, child));) {73+ p = strrchr(child->full_name, '/');74+ if (!p)75+ p = child->full_name;76+ else77+ ++p;78+ ent = proc_mkdir(p, de);79+ if (ent == 0)80+ break;81+ *lastp = ent;82+ ent->next = NULL;83+ lastp = &ent->next;84+ proc_device_tree_add_node(child, ent);85+ }86+ of_node_put(child);87 for (pp = np->properties; pp != 0; pp = pp->next) {88+ /*89+ * Yet another Apple device-tree bogosity: on some machines,90+ * they have properties & nodes with the same name. Those91+ * properties are quite unimportant for us though, thus we92+ * simply "skip" them here, but we do have to check.93+ */94+ for (ent = list; ent != NULL; ent = ent->next)95+ if (!strcmp(ent->name, pp->name))96+ break;97+ if (ent != NULL) {98+ printk(KERN_WARNING "device-tree: property \"%s\" name"99+ " conflicts with node in %s\n", pp->name,100+ np->full_name);101+ continue;102+ }103+104 /*105 * Unfortunately proc_register puts each new entry106 * at the beginning of the list. So we rearrange them.107 */108+ ent = create_proc_read_entry(pp->name,109+ strncmp(pp->name, "security-", 9)110+ ? S_IRUGO : S_IRUSR, de,111+ property_read_proc, pp);112 if (ent == 0)113 break;114 if (!strncmp(pp->name, "security-", 9))115 ent->size = 0; /* don't leak number of password chars */116 else117 ent->size = pp->length;118+ ent->next = NULL;119 *lastp = ent;120 lastp = &ent->next;121 }00000000000000000000000000000000000000000000000000000000122 de->subdir = list;123}124
+1-1
fs/udf/udftime.c
···46#endif4748/* How many days come before each month (0-12). */49-const unsigned short int __mon_yday[2][13] =50{51 /* Normal years. */52 { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
···46#endif4748/* How many days come before each month (0-12). */49+static const unsigned short int __mon_yday[2][13] =50{51 /* Normal years. */52 { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
+1
include/asm-i386/timer.h
···5354extern unsigned long calibrate_tsc(void);55extern void init_cpu_khz(void);056#ifdef CONFIG_HPET_TIMER57extern struct init_timer_opts timer_hpet_init;58extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
···5354extern unsigned long calibrate_tsc(void);55extern void init_cpu_khz(void);56+extern int recalibrate_cpu_khz(void);57#ifdef CONFIG_HPET_TIMER58extern struct init_timer_opts timer_hpet_init;59extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr);
···19 * Define the vendor/device ID for the MPC8265.20 */21#define PCI_DEVICE_ID_MPC8265 ((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA)02223#define M8265_PCIBR0 0x101ac24#define M8265_PCIBR1 0x101b0
···19 * Define the vendor/device ID for the MPC8265.20 */21#define PCI_DEVICE_ID_MPC8265 ((0x18C0 << 16) | PCI_VENDOR_ID_MOTOROLA)22+#define PCI_DEVICE_ID_MPC8272 ((0x18C1 << 16) | PCI_VENDOR_ID_MOTOROLA)2324#define M8265_PCIBR0 0x101ac25#define M8265_PCIBR1 0x101b0
+1-1
include/asm-ppc/mpc8260.h
···41#endif4243#ifdef CONFIG_PCI_826044-#include <syslib/m8260_pci.h>45#endif4647/* Make sure the memory translation stuff is there if PCI not used.
···41#endif4243#ifdef CONFIG_PCI_826044+#include <syslib/m82xx_pci.h>45#endif4647/* Make sure the memory translation stuff is there if PCI not used.
+1-12
include/asm-ppc64/prom.h
···147 struct device_node *sibling;148 struct device_node *next; /* next device of same type */149 struct device_node *allnext; /* next in list of all nodes */150- struct proc_dir_entry *pde; /* this node's proc directory */151- struct proc_dir_entry *name_link; /* name symlink */152- struct proc_dir_entry *addr_link; /* addr symlink */153 struct kref kref;154 unsigned long _flags;155};···172 dn->pde = de;173}174175-static void inline set_node_name_link(struct device_node *dn, struct proc_dir_entry *de)176-{177- dn->name_link = de;178-}179-180-static void inline set_node_addr_link(struct device_node *dn, struct proc_dir_entry *de)181-{182- dn->addr_link = de;183-}184185/* OBSOLETE: Old stlye node lookup */186extern struct device_node *find_devices(const char *name);
···147 struct device_node *sibling;148 struct device_node *next; /* next device of same type */149 struct device_node *allnext; /* next in list of all nodes */150+ struct proc_dir_entry *pde; /* this node's proc directory */00151 struct kref kref;152 unsigned long _flags;153};···174 dn->pde = de;175}176000000000177178/* OBSOLETE: Old stlye node lookup */179extern struct device_node *find_devices(const char *name);
+1-1
include/asm-sh/thread_info.h
···2728#endif2930-#define PREEMPT_ACTIVE 0x40000003132/*33 * macros/functions for gaining access to the thread information structure
···2728#endif2930+#define PREEMPT_ACTIVE 0x100000003132/*33 * macros/functions for gaining access to the thread information structure
+1-1
include/asm-sh64/thread_info.h
···7374#define THREAD_SIZE 81927576-#define PREEMPT_ACTIVE 0x40000007778/* thread information flags */79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
···7374#define THREAD_SIZE 81927576+#define PREEMPT_ACTIVE 0x100000007778/* thread information flags */79#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
···15#include <asm/io.h>16#include <asm/page.h>17#include <asm/oplib.h>01819/* The abstraction used here is that there are PCI controllers,20 * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules···40 * streaming buffers underneath.41 */42 spinlock_t lock;43-44- /* Context allocator. */45- unsigned int iommu_cur_ctx;4647 /* IOMMU page table, a linear array of ioptes. */48 iopte_t *page_table; /* The page table itself. */···84 u16 next;85 u16 flush;86 } alloc_info[PBM_NCLUSTERS];00008788 /* Here a PCI controller driver describes the areas of89 * PCI memory space where DMA to/from physical memory
···15#include <asm/io.h>16#include <asm/page.h>17#include <asm/oplib.h>18+#include <asm/iommu.h>1920/* The abstraction used here is that there are PCI controllers,21 * each with one (Sabre) or two (PSYCHO/SCHIZO) PCI bus modules···39 * streaming buffers underneath.40 */41 spinlock_t lock;0004243 /* IOMMU page table, a linear array of ioptes. */44 iopte_t *page_table; /* The page table itself. */···86 u16 next;87 u16 flush;88 } alloc_info[PBM_NCLUSTERS];89+90+ /* CTX allocation. */91+ unsigned long ctx_lowest_free;92+ unsigned long ctx_bitmap[IOMMU_NUM_CTXS / (sizeof(unsigned long) * 8)];9394 /* Here a PCI controller driver describes the areas of95 * PCI memory space where DMA to/from physical memory
···9899extern unsigned long to_phys(void *virt);100extern void *to_virt(unsigned long phys);101+102+/* Cast to unsigned long before casting to void * to avoid a warning from103+ * mmap_kmem about cutting a long long down to a void *. Not sure that104+ * casting is the right thing, but 32-bit UML can't have 64-bit virtual105+ * addresses106+ */107+#define __pa(virt) to_phys((void *) (unsigned long) virt)108#define __va(phys) to_virt((unsigned long) phys)109110#define page_to_pfn(page) ((page) - mem_map)
-8
include/asm-um/pgtable.h
···114extern unsigned long pg0[1024];115116/*117- * BAD_PAGETABLE is used when we need a bogus page-table, while118- * BAD_PAGE is used for a bogus page.119- *120 * ZERO_PAGE is a global shared page that is always zero: used121 * for zero-mapped memory areas etc..122 */123-extern pte_t __bad_page(void);124-extern pte_t * __bad_pagetable(void);125-126-#define BAD_PAGETABLE __bad_pagetable()127-#define BAD_PAGE __bad_page()128129#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)130
···114extern unsigned long pg0[1024];115116/*000117 * ZERO_PAGE is a global shared page that is always zero: used118 * for zero-mapped memory areas etc..119 */00000120121#define ZERO_PAGE(vaddr) virt_to_page(empty_zero_page)122
+4-5
include/asm-um/thread_info.h
···41#define init_thread_info (init_thread_union.thread_info)42#define init_stack (init_thread_union.stack)43044/* how to get the thread information struct from C */45static inline struct thread_info *current_thread_info(void)46{47 struct thread_info *ti;48- unsigned long mask = PAGE_SIZE *49- (1 << CONFIG_KERNEL_STACK_ORDER) - 1;50- ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);51 return ti;52}5354/* thread information allocation */55-#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)56#define alloc_thread_info(tsk) \57 ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL))58#define free_thread_info(ti) kfree(ti)···6162#endif6364-#define PREEMPT_ACTIVE 0x40000006566#define TIF_SYSCALL_TRACE 0 /* syscall trace active */67#define TIF_SIGPENDING 1 /* signal pending */
···41#define init_thread_info (init_thread_union.thread_info)42#define init_stack (init_thread_union.stack)4344+#define THREAD_SIZE ((1 << CONFIG_KERNEL_STACK_ORDER) * PAGE_SIZE)45/* how to get the thread information struct from C */46static inline struct thread_info *current_thread_info(void)47{48 struct thread_info *ti;49+ unsigned long mask = THREAD_SIZE - 1;50+ ti = (struct thread_info *) (((unsigned long) &ti) & ~mask);051 return ti;52}5354/* thread information allocation */055#define alloc_thread_info(tsk) \56 ((struct thread_info *) kmalloc(THREAD_SIZE, GFP_KERNEL))57#define free_thread_info(ti) kfree(ti)···6263#endif6465+#define PREEMPT_ACTIVE 0x100000006667#define TIF_SYSCALL_TRACE 0 /* syscall trace active */68#define TIF_SIGPENDING 1 /* signal pending */
+1-1
include/linux/cpufreq.h
···49/* Frequency values here are CPU kHz so that hardware which doesn't run 50 * with some frequencies can complain without having to guess what per 51 * cent / per mille means. 52- * Maximum transition latency is in microseconds - if it's unknown,53 * CPUFREQ_ETERNAL shall be used.54 */55
···49/* Frequency values here are CPU kHz so that hardware which doesn't run 50 * with some frequencies can complain without having to guess what per 51 * cent / per mille means. 52+ * Maximum transition latency is in nanoseconds - if it's unknown,53 * CPUFREQ_ETERNAL shall be used.54 */55
+18-4
include/linux/etherdevice.h
···56}5758/**000000000000059 * is_valid_ether_addr - Determine if the given Ethernet address is valid60 * @addr: Pointer to a six-byte array containing the Ethernet address61 *62 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not63- * a multicast address, and is not FF:FF:FF:FF:FF:FF. The multicast64- * and FF:FF:... tests are combined into the single test "!(addr[0]&1)".65 *66 * Return true if the address is valid.67 */68static inline int is_valid_ether_addr(const u8 *addr)69{70- return !(addr[0]&1) && !is_zero_ether_addr(addr);0071}7273/**···97 addr [0] &= 0xfe; /* clear multicast bit */98 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */99}100-#endif101102#endif /* _LINUX_ETHERDEVICE_H */
···56}5758/**59+ * is_multicast_ether_addr - Determine if the given Ethernet address is a60+ * multicast address.61+ *62+ * @addr: Pointer to a six-byte array containing the Ethernet address63+ *64+ * Return true if the address is a multicast address.65+ */66+static inline int is_multicast_ether_addr(const u8 *addr)67+{68+ return addr[0] & 0x01;69+}70+71+/**72 * is_valid_ether_addr - Determine if the given Ethernet address is valid73 * @addr: Pointer to a six-byte array containing the Ethernet address74 *75 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not76+ * a multicast address, and is not FF:FF:FF:FF:FF:FF.077 *78 * Return true if the address is valid.79 */80static inline int is_valid_ether_addr(const u8 *addr)81{82+ /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to83+ * explicitly check for it here. */84+ return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);85}8687/**···83 addr [0] &= 0xfe; /* clear multicast bit */84 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */85}86+#endif /* __KERNEL__ */8788#endif /* _LINUX_ETHERDEVICE_H */
···401 } reg_state;402403 /* Net device features */404- int features;405#define NETIF_F_SG 1 /* Scatter/gather IO. */406#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */407#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */···913extern void dev_set_promiscuity(struct net_device *dev, int inc);914extern void dev_set_allmulti(struct net_device *dev, int inc);915extern void netdev_state_change(struct net_device *dev);0916/* Load a device via the kmod */917extern void dev_load(const char *name);918extern void dev_mcast_init(void);
···401 } reg_state;402403 /* Net device features */404+ unsigned long features;405#define NETIF_F_SG 1 /* Scatter/gather IO. */406#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */407#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */···913extern void dev_set_promiscuity(struct net_device *dev, int inc);914extern void dev_set_allmulti(struct net_device *dev, int inc);915extern void netdev_state_change(struct net_device *dev);916+extern void netdev_features_change(struct net_device *dev);917/* Load a device via the kmod */918extern void dev_load(const char *name);919extern void dev_mcast_init(void);
+1
include/linux/notifier.h
···56#define NETDEV_CHANGEADDR 0x000857#define NETDEV_GOING_DOWN 0x000958#define NETDEV_CHANGENAME 0x000A05960#define SYS_DOWN 0x0001 /* Notify of system down */61#define SYS_RESTART SYS_DOWN
···56#define NETDEV_CHANGEADDR 0x000857#define NETDEV_GOING_DOWN 0x000958#define NETDEV_CHANGENAME 0x000A59+#define NETDEV_FEAT_CHANGE 0x000B6061#define SYS_DOWN 0x0001 /* Notify of system down */62#define SYS_RESTART SYS_DOWN
···442443config MODVERSIONS444 bool "Module versioning support (EXPERIMENTAL)"445- depends on MODULES && EXPERIMENTAL && !UML446 help447 Usually, you have to use modules compiled with your kernel.448 Saying Y here makes it sometimes possible to use modules
···442443config MODVERSIONS444 bool "Module versioning support (EXPERIMENTAL)"445+ depends on MODULES && EXPERIMENTAL446 help447 Usually, you have to use modules compiled with your kernel.448 Saying Y here makes it sometimes possible to use modules
···1758 const char __user *uargs)1759{1760 struct module *mod;01761 int ret = 0;17621763 /* Must have permission */···1776 return PTR_ERR(mod);1777 }17780001779 /* Flush the instruction cache, since we've played with text */1780 if (mod->module_init)1781 flush_icache_range((unsigned long)mod->module_init,···1786 + mod->init_size);1787 flush_icache_range((unsigned long)mod->module_core,1788 (unsigned long)mod->module_core + mod->core_size);0017891790 /* Now sew it into the lists. They won't access us, since1791 strong_try_module_get() will fail. */
···1758 const char __user *uargs)1759{1760 struct module *mod;1761+ mm_segment_t old_fs = get_fs();1762 int ret = 0;17631764 /* Must have permission */···1775 return PTR_ERR(mod);1776 }17771778+ /* flush the icache in correct context */1779+ set_fs(KERNEL_DS);1780+1781 /* Flush the instruction cache, since we've played with text */1782 if (mod->module_init)1783 flush_icache_range((unsigned long)mod->module_init,···1782 + mod->init_size);1783 flush_icache_range((unsigned long)mod->module_core,1784 (unsigned long)mod->module_core + mod->core_size);1785+1786+ set_fs(old_fs);17871788 /* Now sew it into the lists. They won't access us, since1789 strong_try_module_get() will fail. */
+2-1
lib/Kconfig.debug
···151152config FRAME_POINTER153 bool "Compile the kernel with frame pointers"154- depends on DEBUG_KERNEL && ((X86 && !X86_64) || CRIS || M68K || M68KNOMMU || FRV)0155 help156 If you say Y here the resulting kernel image will be slightly larger157 and slower, but it will give very useful debugging information.
···151152config FRAME_POINTER153 bool "Compile the kernel with frame pointers"154+ depends on DEBUG_KERNEL && ((X86 && !X86_64) || CRIS || M68K || M68KNOMMU || FRV || UML)155+ default y if DEBUG_INFO && UML156 help157 If you say Y here the resulting kernel image will be slightly larger158 and slower, but it will give very useful debugging information.
+7-8
net/bridge/br_device.c
···2122static struct net_device_stats *br_dev_get_stats(struct net_device *dev)23{24- struct net_bridge *br;25-26- br = dev->priv;27-28 return &br->statistics;29}30···5152static int br_dev_open(struct net_device *dev)53{54- netif_start_queue(dev);5556- br_stp_enable_bridge(dev->priv);005758 return 0;59}···6667static int br_dev_stop(struct net_device *dev)68{69- br_stp_disable_bridge(dev->priv);7071 netif_stop_queue(dev);72···7576static int br_change_mtu(struct net_device *dev, int new_mtu)77{78- if ((new_mtu < 68) || new_mtu > br_min_mtu(dev->priv))79 return -EINVAL;8081 dev->mtu = new_mtu;
···314 return mtu;315}3160000000000000000000000317/* called with RTNL */318int br_add_if(struct net_bridge *br, struct net_device *dev)319{···390391 spin_lock_bh(&br->lock);392 br_stp_recalculate_bridge_id(br);0393 spin_unlock_bh(&br->lock);394395 return 0;
···314 return mtu;315}316317+/*318+ * Recomputes features using slave's features319+ */320+void br_features_recompute(struct net_bridge *br)321+{322+ struct net_bridge_port *p;323+ unsigned long features, checksum;324+325+ features = NETIF_F_SG | NETIF_F_FRAGLIST 326+ | NETIF_F_HIGHDMA | NETIF_F_TSO;327+ checksum = NETIF_F_IP_CSUM; /* least commmon subset */328+329+ list_for_each_entry(p, &br->port_list, list) {330+ if (!(p->dev->features 331+ & (NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)))332+ checksum = 0;333+ features &= p->dev->features;334+ }335+336+ br->dev->features = features | checksum | NETIF_F_LLTX;337+}338+339/* called with RTNL */340int br_add_if(struct net_bridge *br, struct net_device *dev)341{···368369 spin_lock_bh(&br->lock);370 br_stp_recalculate_bridge_id(br);371+ br_features_recompute(br);372 spin_unlock_bh(&br->lock);373374 return 0;
+5-3
net/bridge/br_input.c
···26#ifdef CONFIG_NETFILTER_DEBUG27 skb->nf_debug = 0;28#endif29- netif_rx(skb);3031 return 0;32}···53 struct net_bridge *br = p->br;54 struct net_bridge_fdb_entry *dst;55 int passedup = 0;0005657 if (br->dev->flags & IFF_PROMISC) {58 struct sk_buff *skb2;···111 if (!is_valid_ether_addr(eth_hdr(skb)->h_source))112 goto err;113114- if (p->state == BR_STATE_LEARNING ||115- p->state == BR_STATE_FORWARDING)116 br_fdb_update(p->br, p, eth_hdr(skb)->h_source);117118 if (p->br->stp_enabled &&
···26#ifdef CONFIG_NETFILTER_DEBUG27 skb->nf_debug = 0;28#endif29+ netif_receive_skb(skb);3031 return 0;32}···53 struct net_bridge *br = p->br;54 struct net_bridge_fdb_entry *dst;55 int passedup = 0;56+57+ /* insert into forwarding database after filtering to avoid spoofing */58+ br_fdb_update(p->br, p, eth_hdr(skb)->h_source);5960 if (br->dev->flags & IFF_PROMISC) {61 struct sk_buff *skb2;···108 if (!is_valid_ether_addr(eth_hdr(skb)->h_source))109 goto err;110111+ if (p->state == BR_STATE_LEARNING)0112 br_fdb_update(p->br, p, eth_hdr(skb)->h_source);113114 if (p->br->stp_enabled &&
+9
net/bridge/br_notify.c
···65 }66 break;6700000000068 case NETDEV_DOWN:69 if (br->dev->flags & IFF_UP)70 br_stp_disable_port(p);
···65 }66 break;6768+ case NETDEV_FEAT_CHANGE:69+ if (br->dev->flags & IFF_UP) 70+ br_features_recompute(br);71+72+ /* could do recursive feature change notification73+ * but who would care?? 74+ */75+ break;76+77 case NETDEV_DOWN:78 if (br->dev->flags & IFF_UP)79 br_stp_disable_port(p);
+1
net/bridge/br_private.h
···174extern int br_del_if(struct net_bridge *br,175 struct net_device *dev);176extern int br_min_mtu(const struct net_bridge *br);0177178/* br_input.c */179extern int br_handle_frame_finish(struct sk_buff *skb);
···174extern int br_del_if(struct net_bridge *br,175 struct net_device *dev);176extern int br_min_mtu(const struct net_bridge *br);177+extern void br_features_recompute(struct net_bridge *br);178179/* br_input.c */180extern int br_handle_frame_finish(struct sk_buff *skb);
+3
net/bridge/br_stp_bpdu.c
···140 struct net_bridge *br = p->br;141 unsigned char *buf;142000143 /* need at least the 802 and STP headers */144 if (!pskb_may_pull(skb, sizeof(header)+1) ||145 memcmp(skb->data, header, sizeof(header)))
···140 struct net_bridge *br = p->br;141 unsigned char *buf;142143+ /* insert into forwarding database after filtering to avoid spoofing */144+ br_fdb_update(p->br, p, eth_hdr(skb)->h_source);145+146 /* need at least the 802 and STP headers */147 if (!pskb_may_pull(skb, sizeof(header)+1) ||148 memcmp(skb->data, header, sizeof(header)))
+12
net/core/dev.c
···761}762763/**000000000000764 * netdev_state_change - device changes state765 * @dev: device to cause notification766 *
···761}762763/**764+ * netdev_features_change - device changes fatures765+ * @dev: device to cause notification766+ *767+ * Called to indicate a device has changed features.768+ */769+void netdev_features_change(struct net_device *dev)770+{771+ notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev);772+}773+EXPORT_SYMBOL(netdev_features_change);774+775+/**776 * netdev_state_change - device changes state777 * @dev: device to cause notification778 *
+18-2
net/core/ethtool.c
···2930u32 ethtool_op_get_tx_csum(struct net_device *dev)31{32- return (dev->features & NETIF_F_IP_CSUM) != 0;33}3435int ethtool_op_set_tx_csum(struct net_device *dev, u32 data)···42 return 0;43}4400000000045u32 ethtool_op_get_sg(struct net_device *dev)46{47 return (dev->features & NETIF_F_SG) != 0;···691 void __user *useraddr = ifr->ifr_data;692 u32 ethcmd;693 int rc;0694695 /*696 * XXX: This can be pushed down into the ethtool_* handlers that···713 if ((rc = dev->ethtool_ops->begin(dev)) < 0)714 return rc;71500716 switch (ethcmd) {717 case ETHTOOL_GSET:718 rc = ethtool_get_settings(dev, useraddr);···724 break;725 case ETHTOOL_GDRVINFO:726 rc = ethtool_get_drvinfo(dev, useraddr);727-728 break;729 case ETHTOOL_GREGS:730 rc = ethtool_get_regs(dev, useraddr);···812813 if(dev->ethtool_ops->complete)814 dev->ethtool_ops->complete(dev);0000815 return rc;816817 ioctl:···832EXPORT_SYMBOL(ethtool_op_set_sg);833EXPORT_SYMBOL(ethtool_op_set_tso);834EXPORT_SYMBOL(ethtool_op_set_tx_csum);0
···2930u32 ethtool_op_get_tx_csum(struct net_device *dev)31{32+ return (dev->features & (NETIF_F_IP_CSUM | NETIF_F_HW_CSUM)) != 0;33}3435int ethtool_op_set_tx_csum(struct net_device *dev, u32 data)···42 return 0;43}4445+int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data)46+{47+ if (data)48+ dev->features |= NETIF_F_HW_CSUM;49+ else50+ dev->features &= ~NETIF_F_HW_CSUM;51+52+ return 0;53+}54u32 ethtool_op_get_sg(struct net_device *dev)55{56 return (dev->features & NETIF_F_SG) != 0;···682 void __user *useraddr = ifr->ifr_data;683 u32 ethcmd;684 int rc;685+ unsigned long old_features;686687 /*688 * XXX: This can be pushed down into the ethtool_* handlers that···703 if ((rc = dev->ethtool_ops->begin(dev)) < 0)704 return rc;705706+ old_features = dev->features;707+708 switch (ethcmd) {709 case ETHTOOL_GSET:710 rc = ethtool_get_settings(dev, useraddr);···712 break;713 case ETHTOOL_GDRVINFO:714 rc = ethtool_get_drvinfo(dev, useraddr);0715 break;716 case ETHTOOL_GREGS:717 rc = ethtool_get_regs(dev, useraddr);···801802 if(dev->ethtool_ops->complete)803 dev->ethtool_ops->complete(dev);804+805+ if (old_features != dev->features)806+ netdev_features_change(dev);807+808 return rc;809810 ioctl:···817EXPORT_SYMBOL(ethtool_op_set_sg);818EXPORT_SYMBOL(ethtool_op_set_tso);819EXPORT_SYMBOL(ethtool_op_set_tx_csum);820+EXPORT_SYMBOL(ethtool_op_set_tx_hw_csum);
···5758static struct multipath_device state[MULTIPATH_MAX_DEVICECANDIDATES];59static DEFINE_SPINLOCK(state_lock);60-static struct rtable *last_selection = NULL;6162static int inline __multipath_findslot(void)63{···110 .notifier_call = drr_dev_event,111};112113-static void drr_remove(struct rtable *rt)114-{115- if (last_selection == rt)116- last_selection = NULL;117-}118119static void drr_safe_inc(atomic_t *usecount)120{···137 int min_usecount = -1; 138 int devidx = -1;139 int cur_min_devidx = -1;140-141- /* if necessary and possible utilize the old alternative */142- if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&143- last_selection != NULL) {144- result = last_selection;145- *rp = result;146- return;147- }148149 /* 1. make sure all alt. nexthops have the same GC related data */150 /* 2. determine the new candidate to be returned */···215 }216217 *rp = result;218- last_selection = result;219}220221static struct ip_mp_alg_ops drr_ops = {222 .mp_alg_select_route = drr_select_route,223- .mp_alg_remove = drr_remove,224};225226static int __init drr_init(void)···228 if (err)229 return err;230231- err = multipath_alg_register(&drr_ops, IP_MP_ALG_RR);232 if (err)233 goto fail;234
···5758static struct multipath_device state[MULTIPATH_MAX_DEVICECANDIDATES];59static DEFINE_SPINLOCK(state_lock);06061static int inline __multipath_findslot(void)62{···111 .notifier_call = drr_dev_event,112};11300000114115static void drr_safe_inc(atomic_t *usecount)116{···143 int min_usecount = -1; 144 int devidx = -1;145 int cur_min_devidx = -1;00000000146147 /* 1. make sure all alt. nexthops have the same GC related data */148 /* 2. determine the new candidate to be returned */···229 }230231 *rp = result;0232}233234static struct ip_mp_alg_ops drr_ops = {235 .mp_alg_select_route = drr_select_route,0236};237238static int __init drr_init(void)···244 if (err)245 return err;246247+ err = multipath_alg_register(&drr_ops, IP_MP_ALG_DRR);248 if (err)249 goto fail;250
-20
net/ipv4/multipath_rr.c
···47#include <net/checksum.h>48#include <net/ip_mp_alg.h>4950-#define MULTIPATH_MAX_CANDIDATES 4051-52-static struct rtable* last_used = NULL;53-54-static void rr_remove(struct rtable *rt)55-{56- if (last_used == rt)57- last_used = NULL;58-}59-60static void rr_select_route(const struct flowi *flp,61 struct rtable *first, struct rtable **rp)62{63 struct rtable *nh, *result, *min_use_cand = NULL;64 int min_use = -1;65-66- /* if necessary and possible utilize the old alternative */67- if ((flp->flags & FLOWI_FLAG_MULTIPATHOLDROUTE) != 0 &&68- last_used != NULL) {69- result = last_used;70- goto out;71- }7273 /* 1. make sure all alt. nexthops have the same GC related data74 * 2. determine the new candidate to be returned···73 if (!result)74 result = first;7576-out:77- last_used = result;78 result->u.dst.__use++;79 *rp = result;80}8182static struct ip_mp_alg_ops rr_ops = {83 .mp_alg_select_route = rr_select_route,84- .mp_alg_remove = rr_remove,85};8687static int __init rr_init(void)
···47#include <net/checksum.h>48#include <net/ip_mp_alg.h>49000000000050static void rr_select_route(const struct flowi *flp,51 struct rtable *first, struct rtable **rp)52{53 struct rtable *nh, *result, *min_use_cand = NULL;54 int min_use = -1;00000005556 /* 1. make sure all alt. nexthops have the same GC related data57 * 2. determine the new candidate to be returned···90 if (!result)91 result = first;920093 result->u.dst.__use++;94 *rp = result;95}9697static struct ip_mp_alg_ops rr_ops = {98 .mp_alg_select_route = rr_select_route,099};100101static int __init rr_init(void)
+10
net/ipv4/netfilter/ip_queue.c
···3 * communicating with userspace via netlink.4 *5 * (C) 2000-2002 James Morris <jmorris@intercode.com.au>06 *7 * This program is free software; you can redistribute it and/or modify8 * it under the terms of the GNU General Public License version 2 as···18 * 2005-01-10: Added /proc counter for dropped packets; fixed so19 * packets aren't delivered to user space if they're going 20 * to be dropped. 021 *22 */23#include <linux/module.h>···73static void74ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)75{00000076 nf_reinject(entry->skb, entry->info, verdict);0077 kfree(entry);78}79
···3 * communicating with userspace via netlink.4 *5 * (C) 2000-2002 James Morris <jmorris@intercode.com.au>6+ * (C) 2003-2005 Netfilter Core Team <coreteam@netfilter.org>7 *8 * This program is free software; you can redistribute it and/or modify9 * it under the terms of the GNU General Public License version 2 as···17 * 2005-01-10: Added /proc counter for dropped packets; fixed so18 * packets aren't delivered to user space if they're going 19 * to be dropped. 20+ * 2005-05-26: local_bh_{disable,enable} around nf_reinject (Harald Welte)21 *22 */23#include <linux/module.h>···71static void72ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict)73{74+ /* TCP input path (and probably other bits) assume to be called75+ * from softirq context, not from syscall, like ipq_issue_verdict is76+ * called. TCP input path deadlocks with locks taken from timer77+ * softirq, e.g. We therefore emulate this by local_bh_disable() */78+79+ local_bh_disable();80 nf_reinject(entry->skb, entry->info, verdict);81+ local_bh_enable();82+83 kfree(entry);84}85
+6-6
net/ipv4/udp.c
···738 unsigned long amount;739740 amount = 0;741- spin_lock_irq(&sk->sk_receive_queue.lock);742 skb = skb_peek(&sk->sk_receive_queue);743 if (skb != NULL) {744 /*···748 */749 amount = skb->len - sizeof(struct udphdr);750 }751- spin_unlock_irq(&sk->sk_receive_queue.lock);752 return put_user(amount, (int __user *)arg);753 }754···848 /* Clear queue. */849 if (flags&MSG_PEEK) {850 int clear = 0;851- spin_lock_irq(&sk->sk_receive_queue.lock);852 if (skb == skb_peek(&sk->sk_receive_queue)) {853 __skb_unlink(skb, &sk->sk_receive_queue);854 clear = 1;855 }856- spin_unlock_irq(&sk->sk_receive_queue.lock);857 if (clear)858 kfree_skb(skb);859 }···1334 struct sk_buff_head *rcvq = &sk->sk_receive_queue;1335 struct sk_buff *skb;13361337- spin_lock_irq(&rcvq->lock);1338 while ((skb = skb_peek(rcvq)) != NULL) {1339 if (udp_checksum_complete(skb)) {1340 UDP_INC_STATS_BH(UDP_MIB_INERRORS);···1345 break;1346 }1347 }1348- spin_unlock_irq(&rcvq->lock);13491350 /* nothing to see, move along */1351 if (skb == NULL)
···738 unsigned long amount;739740 amount = 0;741+ spin_lock_bh(&sk->sk_receive_queue.lock);742 skb = skb_peek(&sk->sk_receive_queue);743 if (skb != NULL) {744 /*···748 */749 amount = skb->len - sizeof(struct udphdr);750 }751+ spin_unlock_bh(&sk->sk_receive_queue.lock);752 return put_user(amount, (int __user *)arg);753 }754···848 /* Clear queue. */849 if (flags&MSG_PEEK) {850 int clear = 0;851+ spin_lock_bh(&sk->sk_receive_queue.lock);852 if (skb == skb_peek(&sk->sk_receive_queue)) {853 __skb_unlink(skb, &sk->sk_receive_queue);854 clear = 1;855 }856+ spin_unlock_bh(&sk->sk_receive_queue.lock);857 if (clear)858 kfree_skb(skb);859 }···1334 struct sk_buff_head *rcvq = &sk->sk_receive_queue;1335 struct sk_buff *skb;13361337+ spin_lock_bh(&rcvq->lock);1338 while ((skb = skb_peek(rcvq)) != NULL) {1339 if (udp_checksum_complete(skb)) {1340 UDP_INC_STATS_BH(UDP_MIB_INERRORS);···1345 break;1346 }1347 }1348+ spin_unlock_bh(&rcvq->lock);13491350 /* nothing to see, move along */1351 if (skb == NULL)
+6-4
net/ipv6/ip6_flowlabel.c
···535 if (err)536 goto done;537538- /* Do not check for fault */539- if (!freq.flr_label)540- copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,541- &fl->label, sizeof(fl->label));00542543 sfl1->fl = fl;544 sfl1->next = np->ipv6_fl_list;
···535 if (err)536 goto done;537538+ if (!freq.flr_label) {539+ if (copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,540+ &fl->label, sizeof(fl->label))) {541+ /* Intentionally ignore fault. */542+ }543+ }544545 sfl1->fl = fl;546 sfl1->next = np->ipv6_fl_list;
+11-5
net/sched/sch_dsmark.c
···18#include <asm/byteorder.h>192021-#if 1 /* control */22#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)23#else24#define DPRINTK(format,args...)···7374 DPRINTK("dsmark_graft(sch %p,[qdisc %p],new %p,old %p)\n",sch,p,new,75 old);76- if (!new)77- new = &noop_qdisc;0000078 sch_tree_lock(sch);79 *old = xchg(&p->q,new);80 if (*old)···168 return;169 for (i = 0; i < p->indices; i++) {170 if (p->mask[i] == 0xff && !p->value[i])171- continue;172 if (walker->count >= walker->skip) {173 if (walker->fn(sch, i+1, walker) < 0) {174 walker->stop = 1;175 break;176 }177 }178- walker->count++;0179 }180}181
···18#include <asm/byteorder.h>192021+#if 0 /* control */22#define DPRINTK(format,args...) printk(KERN_DEBUG format,##args)23#else24#define DPRINTK(format,args...)···7374 DPRINTK("dsmark_graft(sch %p,[qdisc %p],new %p,old %p)\n",sch,p,new,75 old);76+77+ if (new == NULL) {78+ new = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops);79+ if (new == NULL)80+ new = &noop_qdisc;81+ }82+83 sch_tree_lock(sch);84 *old = xchg(&p->q,new);85 if (*old)···163 return;164 for (i = 0; i < p->indices; i++) {165 if (p->mask[i] == 0xff && !p->value[i])166+ goto ignore;167 if (walker->count >= walker->skip) {168 if (walker->fn(sch, i+1, walker) < 0) {169 walker->stop = 1;170 break;171 }172 }173+ignore: 174+ walker->count++;175 }176}177
+6-6
sound/oss/Kconfig
···112113config SOUND_ES1370114 tristate "Ensoniq AudioPCI (ES1370)"115- depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT116 help117 Say Y or M if you have a PCI sound card utilizing the Ensoniq118 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find···125126config SOUND_ES1371127 tristate "Creative Ensoniq AudioPCI 97 (ES1371)"128- depends on SOUND_PRIME!=n && SOUND && PCI && SOUND_GAMEPORT129 help130 Say Y or M if you have a PCI sound card utilizing the Ensoniq131 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if···138139config SOUND_ESSSOLO1140 tristate "ESS Technology Solo1" 141- depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT && PCI142 help143 Say Y or M if you have a PCI sound card utilizing the ESS Technology144 Solo1 chip. To find out if your sound card uses a···179180config SOUND_SONICVIBES181 tristate "S3 SonicVibes"182- depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT183 help184 Say Y or M if you have a PCI sound card utilizing the S3185 SonicVibes chipset. To find out if your sound card uses a···226227config SOUND_TRIDENT228 tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core"229- depends on SOUND_PRIME!=n && SOUND && SOUND_GAMEPORT230 ---help---231 Say Y or M if you have a PCI sound card utilizing the Trident232 4DWave-DX/NX chipset or your mother board chipset has SiS 7018···739740config SOUND_MAD16741 tristate "OPTi MAD16 and/or Mozart based cards"742- depends on SOUND_OSS && SOUND_GAMEPORT743 ---help---744 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi745 82C928 or 82C929 or 82C931) audio interface chip. These chips are
···112113config SOUND_ES1370114 tristate "Ensoniq AudioPCI (ES1370)"115+ depends on SOUND_PRIME!=n && SOUND && PCI116 help117 Say Y or M if you have a PCI sound card utilizing the Ensoniq118 ES1370 chipset, such as Ensoniq's AudioPCI (non-97). To find···125126config SOUND_ES1371127 tristate "Creative Ensoniq AudioPCI 97 (ES1371)"128+ depends on SOUND_PRIME!=n && SOUND && PCI129 help130 Say Y or M if you have a PCI sound card utilizing the Ensoniq131 ES1371 chipset, such as Ensoniq's AudioPCI97. To find out if···138139config SOUND_ESSSOLO1140 tristate "ESS Technology Solo1" 141+ depends on SOUND_PRIME!=n && SOUND && PCI142 help143 Say Y or M if you have a PCI sound card utilizing the ESS Technology144 Solo1 chip. To find out if your sound card uses a···179180config SOUND_SONICVIBES181 tristate "S3 SonicVibes"182+ depends on SOUND_PRIME!=n && SOUND183 help184 Say Y or M if you have a PCI sound card utilizing the S3185 SonicVibes chipset. To find out if your sound card uses a···226227config SOUND_TRIDENT228 tristate "Trident 4DWave DX/NX, SiS 7018 or ALi 5451 PCI Audio Core"229+ depends on SOUND_PRIME!=n && SOUND230 ---help---231 Say Y or M if you have a PCI sound card utilizing the Trident232 4DWave-DX/NX chipset or your mother board chipset has SiS 7018···739740config SOUND_MAD16741 tristate "OPTi MAD16 and/or Mozart based cards"742+ depends on SOUND_OSS743 ---help---744 Answer Y if your card has a Mozart (OAK OTI-601) or MAD16 (OPTi745 82C928 or 82C929 or 82C931) audio interface chip. These chips are
+19-11
sound/ppc/pmac.c
···876 */877static int __init snd_pmac_detect(pmac_t *chip)878{879- struct device_node *sound;880 unsigned int *prop, l;881 struct macio_chip* macio;882···906 chip->is_pbook_G3 = 1;907 chip->node = find_devices("awacs");908 if (chip->node)909- return 0; /* ok */910911 /*912 * powermac G3 models have a node called "davbus"913 * with a child called "sound".914 */915- chip->node = find_devices("davbus");0916 /*917 * if we didn't find a davbus device, try 'i2s-a' since918 * this seems to be what iBooks have919 */920 if (! chip->node) {921 chip->node = find_devices("i2s-a");922- if (chip->node && chip->node->parent && chip->node->parent->parent) {0923 if (device_is_compatible(chip->node->parent->parent,924 "K2-Keylargo"))925 chip->is_k2 = 1;···930 if (! chip->node)931 return -ENODEV;932933- sound = find_devices("sound");934- while (sound && sound->parent != chip->node)935- sound = sound->next;00936 if (! sound)937 return -ENODEV;938 prop = (unsigned int *) get_property(sound, "sub-frame", NULL);···1023 }1024 }1025 if (chip->pdev == NULL)1026- printk(KERN_WARNING "snd-powermac: can't locate macio PCI device !\n");010271028 detect_byte_swap(chip);1029···1032 are available */1033 prop = (unsigned int *) get_property(sound, "sample-rates", &l);1034 if (! prop)1035- prop = (unsigned int *) get_property(sound, "output-frame-rates", &l);01036 if (prop) {1037 int i;1038 chip->freqs_ok = 0;···1060/*1061 * exported - boolean info callbacks for ease of programming1062 */1063-int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)01064{1065 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;1066 uinfo->count = 2;···1070 return 0;1071}10721073-int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)01074{1075 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;1076 uinfo->count = 1;
···876 */877static int __init snd_pmac_detect(pmac_t *chip)878{879+ struct device_node *sound = NULL;880 unsigned int *prop, l;881 struct macio_chip* macio;882···906 chip->is_pbook_G3 = 1;907 chip->node = find_devices("awacs");908 if (chip->node)909+ sound = chip->node;910911 /*912 * powermac G3 models have a node called "davbus"913 * with a child called "sound".914 */915+ if (!chip->node)916+ chip->node = find_devices("davbus");917 /*918 * if we didn't find a davbus device, try 'i2s-a' since919 * this seems to be what iBooks have920 */921 if (! chip->node) {922 chip->node = find_devices("i2s-a");923+ if (chip->node && chip->node->parent &&924+ chip->node->parent->parent) {925 if (device_is_compatible(chip->node->parent->parent,926 "K2-Keylargo"))927 chip->is_k2 = 1;···928 if (! chip->node)929 return -ENODEV;930931+ if (!sound) {932+ sound = find_devices("sound");933+ while (sound && sound->parent != chip->node)934+ sound = sound->next;935+ }936 if (! sound)937 return -ENODEV;938 prop = (unsigned int *) get_property(sound, "sub-frame", NULL);···1019 }1020 }1021 if (chip->pdev == NULL)1022+ printk(KERN_WARNING "snd-powermac: can't locate macio PCI"1023+ " device !\n");10241025 detect_byte_swap(chip);1026···1027 are available */1028 prop = (unsigned int *) get_property(sound, "sample-rates", &l);1029 if (! prop)1030+ prop = (unsigned int *) get_property(sound,1031+ "output-frame-rates", &l);1032 if (prop) {1033 int i;1034 chip->freqs_ok = 0;···1054/*1055 * exported - boolean info callbacks for ease of programming1056 */1057+int snd_pmac_boolean_stereo_info(snd_kcontrol_t *kcontrol,1058+ snd_ctl_elem_info_t *uinfo)1059{1060 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;1061 uinfo->count = 2;···1063 return 0;1064}10651066+int snd_pmac_boolean_mono_info(snd_kcontrol_t *kcontrol,1067+ snd_ctl_elem_info_t *uinfo)1068{1069 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;1070 uinfo->count = 1;