Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F110710097
D9370.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D9370.diff
View Options
Index: head/sys/i386/i386/pmap.c
===================================================================
--- head/sys/i386/i386/pmap.c
+++ head/sys/i386/i386/pmap.c
@@ -440,7 +440,7 @@
* CMAP1/CMAP2 are used for zeroing and copying pages.
* CMAP3 is used for the boot-time memory test.
*/
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
mtx_init(&pc->pc_cmap_lock, "SYSMAPS", NULL, MTX_DEF);
SYSMAP(caddr_t, pc->pc_cmap_pte1, pc->pc_cmap_addr1, 1)
SYSMAP(caddr_t, pc->pc_cmap_pte2, pc->pc_cmap_addr2, 1)
@@ -4206,7 +4206,7 @@
struct pcpu *pc;
sched_pin();
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
cmap_pte2 = pc->pc_cmap_pte2;
mtx_lock(&pc->pc_cmap_lock);
if (*cmap_pte2)
@@ -4237,7 +4237,7 @@
struct pcpu *pc;
sched_pin();
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
cmap_pte2 = pc->pc_cmap_pte2;
mtx_lock(&pc->pc_cmap_lock);
if (*cmap_pte2)
@@ -4264,7 +4264,7 @@
struct pcpu *pc;
sched_pin();
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
cmap_pte1 = pc->pc_cmap_pte1;
cmap_pte2 = pc->pc_cmap_pte2;
mtx_lock(&pc->pc_cmap_lock);
@@ -4299,7 +4299,7 @@
int cnt;
sched_pin();
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
cmap_pte1 = pc->pc_cmap_pte1;
cmap_pte2 = pc->pc_cmap_pte2;
mtx_lock(&pc->pc_cmap_lock);
@@ -5288,7 +5288,7 @@
useclflushopt = (cpu_stdext_feature & CPUID_STDEXT_CLFLUSHOPT) != 0;
if (useclflushopt || (cpu_feature & CPUID_CLFSH) != 0) {
sched_pin();
- pc = pcpu_find(curcpu);
+ pc = get_pcpu();
cmap_pte2 = pc->pc_cmap_pte2;
mtx_lock(&pc->pc_cmap_lock);
if (*cmap_pte2)
Index: head/sys/i386/include/pcpu.h
===================================================================
--- head/sys/i386/include/pcpu.h
+++ head/sys/i386/include/pcpu.h
@@ -76,6 +76,7 @@
extern struct pcpu *pcpup;
+#define get_pcpu() (pcpup)
#define PCPU_GET(member) (pcpup->pc_ ## member)
#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val))
#define PCPU_INC(member) PCPU_ADD(member, 1)
@@ -196,6 +197,15 @@
} \
} while (0)
+#define get_pcpu() __extension__ ({ \
+ struct pcpu *__pc; \
+ \
+ __asm __volatile("movl %%fs:%1,%0" \
+ : "=r" (__pc) \
+ : "m" (*(struct pcpu *)(__pcpu_offset(pc_prvspace)))); \
+ __pc; \
+})
+
#define PCPU_GET(member) __PCPU_GET(pc_ ## member)
#define PCPU_ADD(member, val) __PCPU_ADD(pc_ ## member, val)
#define PCPU_INC(member) __PCPU_INC(pc_ ## member)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 23, 4:27 AM (7 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16788039
Default Alt Text
D9370.diff (2 KB)
Attached To
Mode
D9370: Implement get_pcpu() for i386
Attached
Detach File
Event Timeline
Log In to Comment