diff options
author | David S. Miller <davem@davemloft.net> | 2010-06-26 13:27:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-26 13:27:00 -0400 |
commit | c67dda14389205f0a223c5089307495290939b3b (patch) | |
tree | fad0bb26b28703d02a22ebdd44d94eabac4a2ade /arch/sparc | |
parent | 43bc2db47292a824152145253b1dd2847e7312a3 (diff) | |
parent | 7e27d6e778cd87b6f2415515d7127eba53fe5d02 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/Kconfig | 3 | ||||
-rw-r--r-- | arch/sparc/boot/btfixupprep.c | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/cache.h | 2 | ||||
-rw-r--r-- | arch/sparc/include/asm/scatterlist.h | 5 | ||||
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 108 | ||||
-rw-r--r-- | arch/sparc/math-emu/sfp-util_32.h | 6 | ||||
-rw-r--r-- | arch/sparc/math-emu/sfp-util_64.h | 6 |
7 files changed, 81 insertions, 51 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index d6781ce687e2..6f1470baa314 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -133,6 +133,9 @@ config ZONE_DMA | |||
133 | config NEED_DMA_MAP_STATE | 133 | config NEED_DMA_MAP_STATE |
134 | def_bool y | 134 | def_bool y |
135 | 135 | ||
136 | config NEED_SG_DMA_LENGTH | ||
137 | def_bool y | ||
138 | |||
136 | config GENERIC_ISA_DMA | 139 | config GENERIC_ISA_DMA |
137 | bool | 140 | bool |
138 | default y if SPARC32 | 141 | default y if SPARC32 |
diff --git a/arch/sparc/boot/btfixupprep.c b/arch/sparc/boot/btfixupprep.c index bbf91b9c3d39..e7f2940bd270 100644 --- a/arch/sparc/boot/btfixupprep.c +++ b/arch/sparc/boot/btfixupprep.c | |||
@@ -325,7 +325,7 @@ main1: | |||
325 | (*rr)->next = NULL; | 325 | (*rr)->next = NULL; |
326 | } | 326 | } |
327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); | 327 | printf("! Generated by btfixupprep. Do not edit.\n\n"); |
328 | printf("\t.section\t\".data.init\",#alloc,#write\n\t.align\t4\n\n"); | 328 | printf("\t.section\t\".data..init\",#alloc,#write\n\t.align\t4\n\n"); |
329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); | 329 | printf("\t.global\t___btfixup_start\n___btfixup_start:\n\n"); |
330 | for (i = 0; i < last; i++) { | 330 | for (i = 0; i < last; i++) { |
331 | f = array + i; | 331 | f = array + i; |
diff --git a/arch/sparc/include/asm/cache.h b/arch/sparc/include/asm/cache.h index 78b07009f60a..0588b8c7faa2 100644 --- a/arch/sparc/include/asm/cache.h +++ b/arch/sparc/include/asm/cache.h | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) | 22 | #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT) |
23 | 23 | ||
24 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | 24 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
25 | 25 | ||
26 | #ifdef CONFIG_SPARC32 | 26 | #ifdef CONFIG_SPARC32 |
27 | #include <asm/asi.h> | 27 | #include <asm/asi.h> |
diff --git a/arch/sparc/include/asm/scatterlist.h b/arch/sparc/include/asm/scatterlist.h index d1120257b033..433e45f05fd4 100644 --- a/arch/sparc/include/asm/scatterlist.h +++ b/arch/sparc/include/asm/scatterlist.h | |||
@@ -1,8 +1,9 @@ | |||
1 | #ifndef _SPARC_SCATTERLIST_H | 1 | #ifndef _SPARC_SCATTERLIST_H |
2 | #define _SPARC_SCATTERLIST_H | 2 | #define _SPARC_SCATTERLIST_H |
3 | 3 | ||
4 | #define sg_dma_len(sg) ((sg)->dma_length) | ||
5 | |||
6 | #include <asm-generic/scatterlist.h> | 4 | #include <asm-generic/scatterlist.h> |
7 | 5 | ||
6 | #define ISA_DMA_THRESHOLD (~0UL) | ||
7 | #define ARCH_HAS_SG_CHAIN | ||
8 | |||
8 | #endif /* !(_SPARC_SCATTERLIST_H) */ | 9 | #endif /* !(_SPARC_SCATTERLIST_H) */ |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 2e1698332b6d..44faabc3c02c 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -92,6 +92,8 @@ struct cpu_hw_events { | |||
92 | 92 | ||
93 | /* Enabled/disable state. */ | 93 | /* Enabled/disable state. */ |
94 | int enabled; | 94 | int enabled; |
95 | |||
96 | unsigned int group_flag; | ||
95 | }; | 97 | }; |
96 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; | 98 | DEFINE_PER_CPU(struct cpu_hw_events, cpu_hw_events) = { .enabled = 1, }; |
97 | 99 | ||
@@ -982,53 +984,6 @@ static int collect_events(struct perf_event *group, int max_count, | |||
982 | return n; | 984 | return n; |
983 | } | 985 | } |
984 | 986 | ||
985 | static void event_sched_in(struct perf_event *event) | ||
986 | { | ||
987 | event->state = PERF_EVENT_STATE_ACTIVE; | ||
988 | event->oncpu = smp_processor_id(); | ||
989 | event->tstamp_running += event->ctx->time - event->tstamp_stopped; | ||
990 | if (is_software_event(event)) | ||
991 | event->pmu->enable(event); | ||
992 | } | ||
993 | |||
994 | int hw_perf_group_sched_in(struct perf_event *group_leader, | ||
995 | struct perf_cpu_context *cpuctx, | ||
996 | struct perf_event_context *ctx) | ||
997 | { | ||
998 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
999 | struct perf_event *sub; | ||
1000 | int n0, n; | ||
1001 | |||
1002 | if (!sparc_pmu) | ||
1003 | return 0; | ||
1004 | |||
1005 | n0 = cpuc->n_events; | ||
1006 | n = collect_events(group_leader, perf_max_events - n0, | ||
1007 | &cpuc->event[n0], &cpuc->events[n0], | ||
1008 | &cpuc->current_idx[n0]); | ||
1009 | if (n < 0) | ||
1010 | return -EAGAIN; | ||
1011 | if (check_excludes(cpuc->event, n0, n)) | ||
1012 | return -EINVAL; | ||
1013 | if (sparc_check_constraints(cpuc->event, cpuc->events, n + n0)) | ||
1014 | return -EAGAIN; | ||
1015 | cpuc->n_events = n0 + n; | ||
1016 | cpuc->n_added += n; | ||
1017 | |||
1018 | cpuctx->active_oncpu += n; | ||
1019 | n = 1; | ||
1020 | event_sched_in(group_leader); | ||
1021 | list_for_each_entry(sub, &group_leader->sibling_list, group_entry) { | ||
1022 | if (sub->state != PERF_EVENT_STATE_OFF) { | ||
1023 | event_sched_in(sub); | ||
1024 | n++; | ||
1025 | } | ||
1026 | } | ||
1027 | ctx->nr_active += n; | ||
1028 | |||
1029 | return 1; | ||
1030 | } | ||
1031 | |||
1032 | static int sparc_pmu_enable(struct perf_event *event) | 987 | static int sparc_pmu_enable(struct perf_event *event) |
1033 | { | 988 | { |
1034 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | 989 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); |
@@ -1046,11 +1001,20 @@ static int sparc_pmu_enable(struct perf_event *event) | |||
1046 | cpuc->events[n0] = event->hw.event_base; | 1001 | cpuc->events[n0] = event->hw.event_base; |
1047 | cpuc->current_idx[n0] = PIC_NO_INDEX; | 1002 | cpuc->current_idx[n0] = PIC_NO_INDEX; |
1048 | 1003 | ||
1004 | /* | ||
1005 | * If group events scheduling transaction was started, | ||
1006 | * skip the schedulability test here, it will be peformed | ||
1007 | * at commit time(->commit_txn) as a whole | ||
1008 | */ | ||
1009 | if (cpuc->group_flag & PERF_EVENT_TXN_STARTED) | ||
1010 | goto nocheck; | ||
1011 | |||
1049 | if (check_excludes(cpuc->event, n0, 1)) | 1012 | if (check_excludes(cpuc->event, n0, 1)) |
1050 | goto out; | 1013 | goto out; |
1051 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) | 1014 | if (sparc_check_constraints(cpuc->event, cpuc->events, n0 + 1)) |
1052 | goto out; | 1015 | goto out; |
1053 | 1016 | ||
1017 | nocheck: | ||
1054 | cpuc->n_events++; | 1018 | cpuc->n_events++; |
1055 | cpuc->n_added++; | 1019 | cpuc->n_added++; |
1056 | 1020 | ||
@@ -1130,11 +1094,61 @@ static int __hw_perf_event_init(struct perf_event *event) | |||
1130 | return 0; | 1094 | return 0; |
1131 | } | 1095 | } |
1132 | 1096 | ||
1097 | /* | ||
1098 | * Start group events scheduling transaction | ||
1099 | * Set the flag to make pmu::enable() not perform the | ||
1100 | * schedulability test, it will be performed at commit time | ||
1101 | */ | ||
1102 | static void sparc_pmu_start_txn(const struct pmu *pmu) | ||
1103 | { | ||
1104 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
1105 | |||
1106 | cpuhw->group_flag |= PERF_EVENT_TXN_STARTED; | ||
1107 | } | ||
1108 | |||
1109 | /* | ||
1110 | * Stop group events scheduling transaction | ||
1111 | * Clear the flag and pmu::enable() will perform the | ||
1112 | * schedulability test. | ||
1113 | */ | ||
1114 | static void sparc_pmu_cancel_txn(const struct pmu *pmu) | ||
1115 | { | ||
1116 | struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); | ||
1117 | |||
1118 | cpuhw->group_flag &= ~PERF_EVENT_TXN_STARTED; | ||
1119 | } | ||
1120 | |||
1121 | /* | ||
1122 | * Commit group events scheduling transaction | ||
1123 | * Perform the group schedulability test as a whole | ||
1124 | * Return 0 if success | ||
1125 | */ | ||
1126 | static int sparc_pmu_commit_txn(const struct pmu *pmu) | ||
1127 | { | ||
1128 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
1129 | int n; | ||
1130 | |||
1131 | if (!sparc_pmu) | ||
1132 | return -EINVAL; | ||
1133 | |||
1134 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
1135 | n = cpuc->n_events; | ||
1136 | if (check_excludes(cpuc->event, 0, n)) | ||
1137 | return -EINVAL; | ||
1138 | if (sparc_check_constraints(cpuc->event, cpuc->events, n)) | ||
1139 | return -EAGAIN; | ||
1140 | |||
1141 | return 0; | ||
1142 | } | ||
1143 | |||
1133 | static const struct pmu pmu = { | 1144 | static const struct pmu pmu = { |
1134 | .enable = sparc_pmu_enable, | 1145 | .enable = sparc_pmu_enable, |
1135 | .disable = sparc_pmu_disable, | 1146 | .disable = sparc_pmu_disable, |
1136 | .read = sparc_pmu_read, | 1147 | .read = sparc_pmu_read, |
1137 | .unthrottle = sparc_pmu_unthrottle, | 1148 | .unthrottle = sparc_pmu_unthrottle, |
1149 | .start_txn = sparc_pmu_start_txn, | ||
1150 | .cancel_txn = sparc_pmu_cancel_txn, | ||
1151 | .commit_txn = sparc_pmu_commit_txn, | ||
1138 | }; | 1152 | }; |
1139 | 1153 | ||
1140 | const struct pmu *hw_perf_event_init(struct perf_event *event) | 1154 | const struct pmu *hw_perf_event_init(struct perf_event *event) |
diff --git a/arch/sparc/math-emu/sfp-util_32.h b/arch/sparc/math-emu/sfp-util_32.h index 0ea35afbb914..d1b2aff3c259 100644 --- a/arch/sparc/math-emu/sfp-util_32.h +++ b/arch/sparc/math-emu/sfp-util_32.h | |||
@@ -107,3 +107,9 @@ | |||
107 | 107 | ||
108 | #define abort() \ | 108 | #define abort() \ |
109 | return 0 | 109 | return 0 |
110 | |||
111 | #ifdef __BIG_ENDIAN | ||
112 | #define __BYTE_ORDER __BIG_ENDIAN | ||
113 | #else | ||
114 | #define __BYTE_ORDER __LITTLE_ENDIAN | ||
115 | #endif | ||
diff --git a/arch/sparc/math-emu/sfp-util_64.h b/arch/sparc/math-emu/sfp-util_64.h index d17c9bc72181..425d3cf01af4 100644 --- a/arch/sparc/math-emu/sfp-util_64.h +++ b/arch/sparc/math-emu/sfp-util_64.h | |||
@@ -112,3 +112,9 @@ | |||
112 | 112 | ||
113 | #define abort() \ | 113 | #define abort() \ |
114 | return 0 | 114 | return 0 |
115 | |||
116 | #ifdef __BIG_ENDIAN | ||
117 | #define __BYTE_ORDER __BIG_ENDIAN | ||
118 | #else | ||
119 | #define __BYTE_ORDER __LITTLE_ENDIAN | ||
120 | #endif | ||