Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ffb9164 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds
Browse files

uml: remove page_size()



userspace code used to have to call the kernelspace function page_size() in
order to determine the value of the kernel's PAGE_SIZE.  Since this is now
available directly from kern_constants.h as UM_KERN_PAGE_SIZE, page_size() can
be deleted and calls changed to use the constant.

Signed-off-by: default avatarJeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6e21aec3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include "net_user.h"
#include "os.h"
#include "um_malloc.h"
#include "kern_constants.h"

int tap_open_common(void *dev, char *gate_addr)
{
@@ -215,7 +216,7 @@ static void change(char *dev, char *what, unsigned char *addr,
	sprintf(netmask_buf, "%d.%d.%d.%d", netmask[0], netmask[1], 
		netmask[2], netmask[3]);

	output_len = page_size();
	output_len = UM_KERN_PAGE_SIZE;
	output = um_kmalloc(output_len);
	if(output == NULL)
		printk("change : failed to allocate output buffer\n");
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include "slip_common.h"
#include "os.h"
#include "um_malloc.h"
#include "kern_constants.h"

static int slip_user_init(void *data, void *dev)
{
@@ -89,7 +90,7 @@ static int slip_tramp(char **argv, int fd)
		goto out_close;
	pid = err;

	output_len = page_size();
	output_len = UM_KERN_PAGE_SIZE;
	output = um_kmalloc(output_len);
	if(output == NULL){
		printk("slip_tramp : failed to allocate output buffer\n");
+0 −1
Original line number Diff line number Diff line
@@ -52,7 +52,6 @@ extern void set_tracing(void *t, int tracing);
extern int is_tracing(void *task);
extern int segv_syscall(void);
extern void kern_finish_exec(void *task, int new_pid, unsigned long stack);
extern int page_size(void);
extern unsigned long page_mask(void);
extern int need_finish_fork(void);
extern void free_stack(unsigned long stack, int order);
+0 −5
Original line number Diff line number Diff line
@@ -217,11 +217,6 @@ void cpu_idle(void)
	CHOOSE_MODE(init_idle_tt(), init_idle_skas());
}

int page_size(void)
{
	return PAGE_SIZE;
}

void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
		      pte_t *pte_out)
{
+4 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include "etap.h"
#include "os.h"
#include "um_malloc.h"
#include "kern_constants.h"

#define MAX_PACKET ETH_MAX_PACKET

@@ -50,10 +51,10 @@ static void etap_change(int op, unsigned char *addr, unsigned char *netmask,
	n = os_write_file(fd, &change, sizeof(change));
	if(n != sizeof(change))
		printk("etap_change - request failed, err = %d\n", -n);
	output = um_kmalloc(page_size());
	output = um_kmalloc(UM_KERN_PAGE_SIZE);
	if(output == NULL)
		printk("etap_change : Failed to allocate output buffer\n");
	read_output(fd, output, page_size());
	read_output(fd, output, UM_KERN_PAGE_SIZE);
	if(output != NULL){
		printk("%s", output);
		kfree(output);
@@ -159,7 +160,7 @@ static int etap_open(void *data)

	err = etap_tramp(pri->dev_name, pri->gate_addr, control_fds[0], 
			 control_fds[1], data_fds[0], data_fds[1]);
	output_len = page_size();
	output_len = UM_KERN_PAGE_SIZE;
	output = um_kmalloc(output_len);
	read_output(control_fds[0], output, output_len);

Loading