Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a327a46e
Commit
a327a46e
authored
Mar 25, 2003
by
David Mosberger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ia64: Minor fixes.
parent
0fd564c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
71 deletions
+66
-71
include/asm-ia64/processor.h
include/asm-ia64/processor.h
+1
-1
include/asm-ia64/smp.h
include/asm-ia64/smp.h
+2
-2
include/asm-ia64/unaligned.h
include/asm-ia64/unaligned.h
+63
-68
No files found.
include/asm-ia64/processor.h
View file @
a327a46e
...
...
@@ -376,7 +376,7 @@ extern unsigned long get_wchan (struct task_struct *p);
static
inline
unsigned
long
ia64_get_kr
(
unsigned
long
regnum
)
{
unsigned
long
r
;
unsigned
long
r
=
0
;
switch
(
regnum
)
{
case
0
:
asm
volatile
(
"mov %0=ar.k0"
:
"=r"
(
r
));
break
;
...
...
include/asm-ia64/smp.h
View file @
a327a46e
...
...
@@ -3,7 +3,7 @@
*
* Copyright (C) 1999 VA Linux Systems
* Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
* Copyright (C) 2001-200
2
Hewlett-Packard Co
* Copyright (C) 2001-200
3
Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#ifndef _ASM_IA64_SMP_H
...
...
@@ -74,7 +74,7 @@ cpu_logical_id (int cpuid)
int
i
;
for
(
i
=
0
;
i
<
NR_CPUS
;
++
i
)
if
(
cpu_physical_id
(
i
)
==
(
__u32
)
cpuid
)
if
(
cpu_physical_id
(
i
)
==
cpuid
)
break
;
return
i
;
}
...
...
include/asm-ia64/unaligned.h
View file @
a327a46e
...
...
@@ -7,8 +7,8 @@
* The main single-value unaligned transfer routines. Derived from
* the Linux/Alpha version.
*
* Copyright (C) 1998, 1999 Hewlett-Packard Co
*
Copyright (C) 1998, 1999
David Mosberger-Tang <davidm@hpl.hp.com>
* Copyright (C) 1998, 1999
, 2003
Hewlett-Packard Co
*
David Mosberger-Tang <davidm@hpl.hp.com>
*/
#define get_unaligned(ptr) \
((__typeof__(*(ptr)))ia64_get_unaligned((ptr), sizeof(*(ptr))))
...
...
@@ -16,110 +16,105 @@
#define put_unaligned(x,ptr) \
ia64_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr)))
/*
* EGCS 1.1 knows about arbitrary unaligned loads. Define some
* packed structures to talk about such things with.
*/
struct
__una_u64
{
__u64
x
__attribute__
((
packed
));
};
struct
__una_u32
{
__u32
x
__attribute__
((
packed
));
};
struct
__una_u16
{
__u16
x
__attribute__
((
packed
));
};
static
inline
unsigned
long
__uld
q
(
const
unsigned
long
*
r11
)
__uld
8
(
const
unsigned
long
*
addr
)
{
const
struct
__una_u64
*
ptr
=
(
const
struct
__una_u64
*
)
r11
;
const
struct
__una_u64
*
ptr
=
(
const
struct
__una_u64
*
)
addr
;
return
ptr
->
x
;
}
static
inline
unsigned
long
__uld
l
(
const
unsigned
int
*
r11
)
__uld
4
(
const
unsigned
int
*
addr
)
{
const
struct
__una_u32
*
ptr
=
(
const
struct
__una_u32
*
)
r11
;
const
struct
__una_u32
*
ptr
=
(
const
struct
__una_u32
*
)
addr
;
return
ptr
->
x
;
}
static
inline
unsigned
long
__uld
w
(
const
unsigned
short
*
r11
)
__uld
2
(
const
unsigned
short
*
addr
)
{
const
struct
__una_u16
*
ptr
=
(
const
struct
__una_u16
*
)
r11
;
const
struct
__una_u16
*
ptr
=
(
const
struct
__una_u16
*
)
addr
;
return
ptr
->
x
;
}
static
inline
void
__ust
q
(
unsigned
long
r5
,
unsigned
long
*
r11
)
__ust
8
(
unsigned
long
val
,
unsigned
long
*
addr
)
{
struct
__una_u64
*
ptr
=
(
struct
__una_u64
*
)
r11
;
ptr
->
x
=
r5
;
struct
__una_u64
*
ptr
=
(
struct
__una_u64
*
)
addr
;
ptr
->
x
=
val
;
}
static
inline
void
__ust
l
(
unsigned
long
r5
,
unsigned
int
*
r11
)
__ust
4
(
unsigned
long
val
,
unsigned
int
*
addr
)
{
struct
__una_u32
*
ptr
=
(
struct
__una_u32
*
)
r11
;
ptr
->
x
=
r5
;
struct
__una_u32
*
ptr
=
(
struct
__una_u32
*
)
addr
;
ptr
->
x
=
val
;
}
static
inline
void
__ust
w
(
unsigned
long
r5
,
unsigned
short
*
r11
)
__ust
2
(
unsigned
long
val
,
unsigned
short
*
addr
)
{
struct
__una_u16
*
ptr
=
(
struct
__una_u16
*
)
r11
;
ptr
->
x
=
r5
;
struct
__una_u16
*
ptr
=
(
struct
__una_u16
*
)
addr
;
ptr
->
x
=
val
;
}
/*
* This function doesn't actually exist. The idea is that when
* someone uses the macros below with an unsupported size (datatype),
* the linker will alert us to the problem via an unresolved reference
* error.
* This function doesn't actually exist. The idea is that when someone uses the macros
* below with an unsupported size (datatype), the linker will alert us to the problem via
* an unresolved reference error.
*/
extern
unsigned
long
ia64_bad_unaligned_access_length
(
void
);
#define ia64_get_unaligned(_ptr,size) \
({ \
const void *
ptr = (_ptr);
\
unsigned long
val;
\
\
switch (size) { \
case 1: \
val = *(const unsigned char *)
ptr; \
break; \
case 2: \
val = __uldw((const unsigned short *)
ptr); \
break; \
case 4: \
val = __uldl((const unsigned int *)ptr);
\
break; \
case 8: \
val = __uldq((const unsigned long *)ptr);
\
break; \
default: \
val = ia64_bad_unaligned_access_length();
\
} \
val;
\
#define ia64_get_unaligned(_ptr,size)
\
({
\
const void *
__ia64_ptr = (_ptr);
\
unsigned long
__ia64_val;
\
\
switch (size) {
\
case 1:
\
__ia64_val = *(const unsigned char *) __ia64_
ptr; \
break;
\
case 2:
\
__ia64_val = __uld2((const unsigned short *)__ia64_
ptr); \
break;
\
case 4:
\
__ia64_val = __uld4((const unsigned int *)__ia64_ptr);
\
break;
\
case 8:
\
__ia64_val = __uld8((const unsigned long *)__ia64_ptr);
\
break;
\
default:
\
__ia64_val = ia64_bad_unaligned_access_length();
\
}
\
__ia64_val;
\
})
#define ia64_put_unaligned(_val,_ptr,size) \
do { \
const void *
ptr = (_ptr);
\
unsigned long
val = (_val);
\
\
switch (size) { \
case 1: \
*(unsigned char *)
ptr = (
val); \
break; \
case 2: \
__ust
w(val, (unsigned short *)
ptr); \
break; \
case 4: \
__ust
l(val, (unsigned int *)ptr);
\
break; \
case 8: \
__ust
q(val, (unsigned long *)
ptr); \
break; \
default: \
ia64_bad_unaligned_access_length(); \
} \
#define ia64_put_unaligned(_val,_ptr,size)
\
do {
\
const void *
__ia64_ptr = (_ptr);
\
unsigned long
__ia64_val = (_val);
\
\
switch (size) {
\
case 1:
\
*(unsigned char *)
__ia64_ptr = (__ia64_
val); \
break;
\
case 2:
\
__ust
2(__ia64_val, (unsigned short *)__ia64_
ptr); \
break;
\
case 4:
\
__ust
4(__ia64_val, (unsigned int *)__ia64_ptr);
\
break;
\
case 8:
\
__ust
8(__ia64_val, (unsigned long *)__ia64_
ptr); \
break;
\
default:
\
ia64_bad_unaligned_access_length();
\
}
\
} while (0)
#endif
/* _ASM_IA64_UNALIGNED_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment