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
Kirill Smelkov
linux
Commits
631516bb
Commit
631516bb
authored
Sep 28, 2002
by
Jeff Dike
Browse files
Options
Browse Files
Download
Plain Diff
Took the 2.5.39 Makefile changes.
parents
b2fd37fa
c23ed05e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
151 additions
and
95 deletions
+151
-95
arch/um/defconfig
arch/um/defconfig
+3
-0
arch/um/drivers/ubd_kern.c
arch/um/drivers/ubd_kern.c
+80
-85
arch/um/kernel/mem.c
arch/um/kernel/mem.c
+1
-1
arch/um/kernel/process_kern.c
arch/um/kernel/process_kern.c
+2
-2
arch/um/kernel/reboot.c
arch/um/kernel/reboot.c
+1
-1
arch/um/kernel/sys_call_table.c
arch/um/kernel/sys_call_table.c
+15
-1
arch/um/vmlinux.lds.S
arch/um/vmlinux.lds.S
+2
-2
include/asm-um/irq.h
include/asm-um/irq.h
+0
-1
include/asm-um/percpu.h
include/asm-um/percpu.h
+2
-2
include/asm-um/pgtable.h
include/asm-um/pgtable.h
+12
-0
include/asm-um/system-i386.h
include/asm-um/system-i386.h
+31
-0
include/asm-um/timex.h
include/asm-um/timex.h
+2
-0
No files found.
arch/um/defconfig
View file @
631516bb
...
...
@@ -206,6 +206,9 @@ CONFIG_EXT2_FS=y
# CONFIG_UDF_RW is not set
# CONFIG_UFS_FS is not set
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_XFS_FS is not set
# CONFIG_XFS_RT is not set
# CONFIG_XFS_QUOTA is not set
#
# Network File Systems
...
...
arch/um/drivers/ubd_kern.c
View file @
631516bb
...
...
@@ -15,7 +15,6 @@
#include "linux/blk.h"
#include "linux/blkdev.h"
#include "linux/hdreg.h"
#include "linux/ide.h"
#include "linux/init.h"
#include "linux/devfs_fs_kernel.h"
#include "linux/cdrom.h"
...
...
@@ -66,29 +65,44 @@ static struct block_device_operations ubd_blops = {
revalidate:
ubd_revalidate
,
};
static
struct
hd_struct
ubd_part
[
MAX_MINOR
]
=
{
[
0
...
MAX_MINOR
-
1
]
=
{
0
,
0
,
0
}
};
static
request_queue_t
*
ubd_queue
;
static
int
fake_major
=
0
;
#define INIT_GENDISK(maj,
name, parts, shift, blops
) \
#define INIT_GENDISK(maj,
index
) \
{ \
major : maj, \
major_name : name, \
minor_shift : shift, \
part : parts, \
next : NULL, \
fops : blops, \
flags : 0 \
}
static
struct
gendisk
ubd_gendisk
=
INIT_GENDISK
(
MAJOR_NR
,
"ubd"
,
ubd_part
,
UBD_SHIFT
,
&
ubd_blops
);
static
struct
gendisk
fake_gendisk
=
INIT_GENDISK
(
0
,
"ubd"
,
ubd_part
,
UBD_SHIFT
,
&
ubd_blops
);
.major = maj, \
.major_name = "ubd", \
.minor_shift = UBD_SHIFT, \
.first_minor = index << UBD_SHIFT, \
.part = NULL, \
.next = NULL, \
.fops = &ubd_blops, \
.flags = GENHD_FL_DRIVERFS \
}
static
struct
gendisk
ubd_gendisk
[
MAX_DEV
]
=
{
INIT_GENDISK
(
MAJOR_NR
,
0
),
INIT_GENDISK
(
MAJOR_NR
,
1
),
INIT_GENDISK
(
MAJOR_NR
,
2
),
INIT_GENDISK
(
MAJOR_NR
,
3
),
INIT_GENDISK
(
MAJOR_NR
,
4
),
INIT_GENDISK
(
MAJOR_NR
,
5
),
INIT_GENDISK
(
MAJOR_NR
,
6
),
INIT_GENDISK
(
MAJOR_NR
,
7
)
};
static
struct
gendisk
fake_gendisk
[
MAX_DEV
]
=
{
INIT_GENDISK
(
0
,
0
),
INIT_GENDISK
(
0
,
1
),
INIT_GENDISK
(
0
,
2
),
INIT_GENDISK
(
0
,
3
),
INIT_GENDISK
(
0
,
4
),
INIT_GENDISK
(
0
,
5
),
INIT_GENDISK
(
0
,
6
),
INIT_GENDISK
(
0
,
7
)
};
#ifdef CONFIG_BLK_DEV_UBD_SYNC
#define OPEN_FLAGS ((struct openflags) { r : 1, w : 1, s : 1, c : 0 })
#else
...
...
@@ -220,11 +234,12 @@ static int ubd_setup_common(char *str, int *index_out)
{
struct
openflags
flags
=
global_openflags
;
char
*
backing_file
;
int
n
;
int
i
,
n
;
if
(
index_out
)
*
index_out
=
-
1
;
n
=
*
str
++
;
if
(
n
==
'='
){
static
int
fake_major_allowed
=
1
;
char
*
end
;
int
major
;
...
...
@@ -238,8 +253,17 @@ static int ubd_setup_common(char *str, int *index_out)
"ubd_setup : didn't parse major number
\n
"
);
return
(
1
);
}
fake_gendisk
.
major
=
major
;
if
(
!
fake_major_allowed
){
printk
(
KERN_ERR
"Can't assign a fake major twice
\n
"
);
return
(
1
);
}
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
fake_gendisk
[
i
].
major
=
major
;
fake_major
=
major
;
fake_major_allowed
=
0
;
printk
(
KERN_INFO
"Setting extra ubd major number to %d
\n
"
,
major
);
return
(
0
);
...
...
@@ -315,9 +339,14 @@ __uml_help(ubd_setup,
static
int
fakehd
(
char
*
str
)
{
int
i
;
printk
(
KERN_INFO
"fakehd : Changing ubd_gendisk.major_name to
\"
hd
\"
.
\n
"
);
ubd_gendisk
.
major_name
=
"hd"
;
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
ubd_gendisk
[
i
].
major_name
=
"hd"
;
return
(
1
);
}
...
...
@@ -401,14 +430,9 @@ static int ubd_add(int n)
{
devfs_handle_t
real
,
fake
;
char
name
[
sizeof
(
"nnnnnn
\0
"
)],
dev_name
[
sizeof
(
"ubd0x"
)];
int
err
;
if
(
ubd_dev
[
n
].
file
==
NULL
)
return
(
-
1
);
err
=
ubd_revalidate
(
mk_kdev
(
MAJOR_NR
,
n
<<
UBD_SHIFT
));
if
(
err
)
return
(
err
);
sprintf
(
name
,
"%d"
,
n
);
real
=
devfs_register
(
ubd_dir_handle
,
name
,
DEVFS_FL_REMOVABLE
,
MAJOR_NR
,
n
<<
UBD_SHIFT
,
...
...
@@ -427,9 +451,9 @@ static int ubd_add(int n)
if
(
real
==
NULL
)
return
(
-
1
);
ubd_dev
[
n
].
real
=
real
;
if
(
!
strcmp
(
ubd_gendisk
.
major_name
,
"ubd"
))
sprintf
(
dev_name
,
"%s%d"
,
ubd_gendisk
.
major_name
,
n
);
else
sprintf
(
dev_name
,
"%s%c"
,
ubd_gendisk
.
major_name
,
if
(
!
strcmp
(
ubd_gendisk
[
n
]
.
major_name
,
"ubd"
))
sprintf
(
dev_name
,
"%s%d"
,
ubd_gendisk
[
n
]
.
major_name
,
n
);
else
sprintf
(
dev_name
,
"%s%c"
,
ubd_gendisk
[
n
]
.
major_name
,
n
+
'a'
);
make_ide_entries
(
dev_name
);
...
...
@@ -510,7 +534,8 @@ int ubd_init(void)
INIT_QUEUE
(
ubd_queue
,
do_ubd_request
,
&
ubd_lock
);
INIT_ELV
(
ubd_queue
,
&
ubd_queue
->
elevator
);
INIT_HARDSECT
(
hardsect_size
,
MAJOR_NR
,
hardsect_sizes
);
add_gendisk
(
&
ubd_gendisk
);
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
add_disk
(
&
ubd_gendisk
[
i
]);
if
(
fake_major
!=
0
){
char
name
[
sizeof
(
"ubd_nnn
\0
"
)];
...
...
@@ -523,9 +548,11 @@ int ubd_init(void)
}
blk_dev
[
fake_major
].
queue
=
ubd_get_queue
;
INIT_HARDSECT
(
hardsect_size
,
fake_major
,
hardsect_sizes
);
add_gendisk
(
&
fake_gendisk
);
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
add_disk
(
&
fake_gendisk
[
i
]);
}
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
ubd_add
(
i
);
for
(
i
=
0
;
i
<
MAX_DEV
;
i
++
)
ubd_add
(
i
);
return
(
0
);
}
...
...
@@ -647,9 +674,8 @@ static int ubd_open(struct inode *inode, struct file *filp)
"errno = %d
\n
"
,
n
,
dev
->
file
,
-
err
);
return
(
err
);
}
err
=
ubd_
file_size
(
dev
,
&
dev
->
size
);
err
=
ubd_
revalidate
(
inode
->
i_rdev
);
if
(
err
)
return
(
err
);
ubd_part
[
offset
].
nr_sects
=
dev
->
size
/
hardsect_sizes
[
offset
];
}
dev
->
count
++
;
if
((
filp
->
f_mode
&
FMODE_WRITE
)
&&
!
dev
->
openflags
.
w
){
...
...
@@ -667,10 +693,14 @@ static int ubd_release(struct inode * inode, struct file * file)
offset
=
n
<<
UBD_SHIFT
;
if
(
n
>
MAX_DEV
)
return
-
ENODEV
;
if
(
--
ubd_dev
[
n
].
count
==
0
){
ubd_close
(
&
ubd_dev
[
n
]);
ubd_part
[
offset
].
nr_sects
=
0
;
del_gendisk
(
&
ubd_gendisk
[
n
]);
if
(
fake_major
!=
0
)
del_gendisk
(
&
fake_gendisk
[
n
]);
}
return
(
0
);
}
...
...
@@ -741,7 +771,6 @@ static int prepare_request(struct request *req, struct io_thread_req *io_req)
return
(
1
);
}
req
->
sector
+=
ubd_part
[
min
].
start_sect
;
block
=
req
->
sector
;
nsect
=
req
->
current_nr_sectors
;
...
...
@@ -816,15 +845,6 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
g
.
cylinders
=
dev
->
size
/
(
128
*
32
*
hardsect_sizes
[
min
]);
g
.
start
=
2
;
return
(
copy_to_user
(
loc
,
&
g
,
sizeof
(
g
))
?
-
EFAULT
:
0
);
case
BLKGETSIZE
:
/* Return device size */
if
(
!
arg
)
return
(
-
EINVAL
);
err
=
verify_area
(
VERIFY_WRITE
,
(
long
*
)
arg
,
sizeof
(
long
));
if
(
err
)
return
(
err
);
put_user
(
ubd_part
[
min
].
nr_sects
,
(
long
*
)
arg
);
return
(
0
);
case
BLKRRPART
:
/* Re-read partition tables */
return
(
ubd_revalidate
(
inode
->
i_rdev
));
case
HDIO_SET_UNMASKINTR
:
if
(
!
capable
(
CAP_SYS_ADMIN
))
return
(
-
EACCES
);
...
...
@@ -877,9 +897,9 @@ static int ubd_ioctl(struct inode * inode, struct file * file,
static
int
ubd_revalidate
(
kdev_t
rdev
)
{
int
i
,
n
,
offset
,
err
,
pcount
=
1
<<
UBD_SHIFT
;
__u64
size
;
int
n
,
offset
,
err
;
struct
ubd
*
dev
;
struct
hd_struct
*
part
;
n
=
minor
(
rdev
)
>>
UBD_SHIFT
;
offset
=
n
<<
UBD_SHIFT
;
...
...
@@ -887,45 +907,20 @@ static int ubd_revalidate(kdev_t rdev)
if
(
dev
->
is_dir
)
return
(
0
);
part
=
&
ubd_part
[
offset
];
/* clear all old partition counts */
for
(
i
=
1
;
i
<
pcount
;
i
++
)
{
part
[
i
].
start_sect
=
0
;
part
[
i
].
nr_sects
=
0
;
}
/* If it already has been opened we can check the partitions
* directly
*/
if
(
dev
->
count
){
part
->
start_sect
=
0
;
register_disk
(
&
ubd_gendisk
,
mk_kdev
(
MAJOR_NR
,
offset
),
pcount
,
&
ubd_blops
,
part
->
nr_sects
);
}
else
if
(
dev
->
file
){
err
=
ubd_open_dev
(
dev
);
if
(
err
){
printk
(
KERN_ERR
"unable to open %s for validation
\n
"
,
dev
->
file
);
return
(
err
);
}
/* have to recompute sizes since we opened it */
err
=
ubd_file_size
(
dev
,
&
dev
->
size
);
if
(
err
)
{
ubd_close
(
dev
);
return
(
err
);
}
part
->
start_sect
=
0
;
part
->
nr_sects
=
dev
->
size
/
hardsect_sizes
[
offset
];
register_disk
(
&
ubd_gendisk
,
mk_kdev
(
MAJOR_NR
,
offset
),
pcount
,
&
ubd_blops
,
part
->
nr_sects
);
/* we are done so close it */
err
=
ubd_file_size
(
dev
,
&
size
);
if
(
err
)
{
ubd_close
(
dev
);
}
else
return
(
-
ENODEV
);
return
(
err
);
}
if
(
size
!=
dev
->
size
){
set_capacity
(
&
ubd_gendisk
[
n
],
size
/
hardsect_sizes
[
offset
]);
if
(
fake_major
!=
0
)
set_capacity
(
&
fake_gendisk
[
n
],
size
/
hardsect_sizes
[
offset
]);
dev
->
size
=
size
;
}
return
(
0
);
}
...
...
arch/um/kernel/mem.c
View file @
631516bb
...
...
@@ -233,7 +233,7 @@ struct page *arch_validate(struct page *page, int mask, int order)
addr
+=
PAGE_SIZE
;
}
if
(
i
==
(
1
<<
order
))
return
(
page
);
page
=
_
alloc_pages
(
mask
,
order
);
page
=
alloc_pages
(
mask
,
order
);
goto
again
;
}
...
...
arch/um/kernel/process_kern.c
View file @
631516bb
...
...
@@ -48,7 +48,7 @@ struct task_struct *get_task(int pid, int require)
ret
=
NULL
;
read_lock
(
&
tasklist_lock
);
for_each_
task
(
task
){
for_each_
process
(
task
){
if
(
task
->
pid
==
pid
){
ret
=
task
;
break
;
...
...
@@ -64,7 +64,7 @@ int is_valid_pid(int pid)
struct
task_struct
*
task
;
read_lock
(
&
tasklist_lock
);
for_each_
task
(
task
){
for_each_
process
(
task
){
if
(
task
->
thread
.
extern_pid
==
pid
){
read_unlock
(
&
tasklist_lock
);
return
(
1
);
...
...
arch/um/kernel/reboot.c
View file @
631516bb
...
...
@@ -15,7 +15,7 @@ static void kill_off_processes(void)
int
me
;
me
=
os_getpid
();
for_each_
task
(
p
){
for_each_
process
(
p
){
if
(
p
->
thread
.
extern_pid
!=
me
)
os_kill_process
(
p
->
thread
.
extern_pid
);
}
...
...
arch/um/kernel/sys_call_table.c
View file @
631516bb
...
...
@@ -223,6 +223,12 @@ extern syscall_handler_t sys_sendfile64;
extern
syscall_handler_t
sys_futex
;
extern
syscall_handler_t
sys_sched_setaffinity
;
extern
syscall_handler_t
sys_sched_getaffinity
;
extern
syscall_handler_t
sys_io_setup
;
extern
syscall_handler_t
sys_io_destroy
;
extern
syscall_handler_t
sys_io_getevents
;
extern
syscall_handler_t
sys_io_submit
;
extern
syscall_handler_t
sys_io_cancel
;
extern
syscall_handler_t
sys_exit_group
;
#if CONFIG_NFSD
#define NFSSERVCTL sys_nfsserctl
...
...
@@ -234,7 +240,7 @@ extern syscall_handler_t um_mount;
extern
syscall_handler_t
um_time
;
extern
syscall_handler_t
um_stime
;
#define LAST_GENERIC_SYSCALL __NR_
sched_getaffinity
#define LAST_GENERIC_SYSCALL __NR_
exit_group
#if LAST_GENERIC_SYSCALL > LAST_ARCH_SYSCALL
#define LAST_SYSCALL LAST_GENERIC_SYSCALL
...
...
@@ -465,6 +471,14 @@ syscall_handler_t *sys_call_table[] = {
[
__NR_futex
]
=
sys_futex
,
[
__NR_sched_setaffinity
]
=
sys_sched_setaffinity
,
[
__NR_sched_getaffinity
]
=
sys_sched_getaffinity
,
[
__NR_io_setup
]
=
sys_io_setup
,
[
__NR_io_destroy
]
=
sys_io_destroy
,
[
__NR_io_getevents
]
=
sys_io_getevents
,
[
__NR_io_submit
]
=
sys_io_submit
,
[
__NR_io_cancel
]
=
sys_io_cancel
,
[
__NR_alloc_hugepages
]
=
sys_ni_syscall
,
[
__NR_free_hugepages
]
=
sys_ni_syscall
,
[
__NR_exit_group
]
=
sys_exit_group
,
ARCH_SYSCALLS
[
LAST_SYSCALL
+
1
...
NR_syscalls
]
=
...
...
arch/um/
link.ld.in
→
arch/um/
vmlinux.lds.S
View file @
631516bb
OUTPUT_FORMAT(
"ELF_FORMAT"
)
OUTPUT_FORMAT
(
ELF_FORMAT
)
OUTPUT_ARCH
(
ELF_ARCH
)
ENTRY
(
_start
)
jiffies
=
jiffies_64
;
SECTIONS
{
. = START
()
+ SIZEOF_HEADERS;
.
=
START
+
SIZEOF_HEADERS
;
.
=
ALIGN
(
4096
)
;
__binary_start
=
.
;
...
...
include/asm-um/irq.h
View file @
631516bb
...
...
@@ -6,7 +6,6 @@
*/
struct
task_struct
;
#include "asm/arch/irq.h"
#include "asm/ptrace.h"
#undef NR_IRQS
...
...
include/asm-um/percpu.h
View file @
631516bb
#ifndef __UM_
CACHEFLUSH
_H
#define __UM_
CACHEFLUSH
_H
#ifndef __UM_
PERCPU
_H
#define __UM_
PERCPU
_H
#include "asm/arch/percpu.h"
...
...
include/asm-um/pgtable.h
View file @
631516bb
...
...
@@ -358,6 +358,18 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
#define pte_unmap(pte) kunmap_atomic(pte, KM_PTE0)
#define pte_unmap_nested(pte) kunmap_atomic(pte, KM_PTE1)
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM4G)
typedef
u32
pte_addr_t
;
#endif
#if defined(CONFIG_HIGHPTE) && defined(CONFIG_HIGHMEM64G)
typedef
u64
pte_addr_t
;
#endif
#if !defined(CONFIG_HIGHPTE)
typedef
pte_t
*
pte_addr_t
;
#endif
#define update_mmu_cache(vma,address,pte) do ; while (0)
/* Encode and de-code a swap entry */
...
...
include/asm-um/system-i386.h
View file @
631516bb
...
...
@@ -3,4 +3,35 @@
#include "asm/system-generic.h"
static
inline
unsigned
long
__cmpxchg
(
volatile
void
*
ptr
,
unsigned
long
old
,
unsigned
long
new
,
int
size
)
{
unsigned
long
prev
;
switch
(
size
)
{
case
1
:
__asm__
__volatile__
(
LOCK_PREFIX
"cmpxchgb %b1,%2"
:
"=a"
(
prev
)
:
"q"
(
new
),
"m"
(
*
__xg
(
ptr
)),
"0"
(
old
)
:
"memory"
);
return
prev
;
case
2
:
__asm__
__volatile__
(
LOCK_PREFIX
"cmpxchgw %w1,%2"
:
"=a"
(
prev
)
:
"q"
(
new
),
"m"
(
*
__xg
(
ptr
)),
"0"
(
old
)
:
"memory"
);
return
prev
;
case
4
:
__asm__
__volatile__
(
LOCK_PREFIX
"cmpxchgl %1,%2"
:
"=a"
(
prev
)
:
"q"
(
new
),
"m"
(
*
__xg
(
ptr
)),
"0"
(
old
)
:
"memory"
);
return
prev
;
}
return
old
;
}
#define cmpxchg(ptr,o,n)\
((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
(unsigned long)(n),sizeof(*(ptr))))
#endif
include/asm-um/timex.h
View file @
631516bb
...
...
@@ -12,4 +12,6 @@ static inline cycles_t get_cycles (void)
return
0
;
}
#define CLOCK_TICK_RATE (HZ)
#endif
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