diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-07-15 10:25:46 +1000 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2014-10-29 16:16:41 +0530 |
commit | 34729a27ecf348731601da76f627adaeff4d7e95 (patch) | |
tree | e327d72a660be02f923f76c0955c5184c22d3440 | |
parent | 8d29a177104c23b177a3e6ff90bdb716d075b510 (diff) | |
download | SLOF-34729a27ecf348731601da76f627adaeff4d7e95.zip SLOF-34729a27ecf348731601da76f627adaeff4d7e95.tar.gz SLOF-34729a27ecf348731601da76f627adaeff4d7e95.tar.bz2 |
net-snk: Remove snk_kernel_interface and related definitions
None of this if of any use anymore
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | clients/net-snk/include/netdriver_int.h | 24 | ||||
-rw-r--r-- | clients/net-snk/kernel/init.c | 23 | ||||
-rw-r--r-- | clients/net-snk/kernel/modules.c | 5 | ||||
-rw-r--r-- | clients/net-snk/oflib/ci_device.c | 4 | ||||
-rw-r--r-- | clients/net-snk/oflib/of.c | 6 | ||||
-rw-r--r-- | clients/net-snk/oflib/rtas.c | 16 |
6 files changed, 13 insertions, 65 deletions
diff --git a/clients/net-snk/include/netdriver_int.h b/clients/net-snk/include/netdriver_int.h index d7ebe87..1ebfd75 100644 --- a/clients/net-snk/include/netdriver_int.h +++ b/clients/net-snk/include/netdriver_int.h @@ -72,30 +72,6 @@ typedef int (*k_ioctl_t) (int, int, void *); typedef void (*modules_remove_t) (int); typedef snk_module_t *(*modules_load_t) (int); -typedef struct { - int version; - print_t print; - us_delay_t us_delay; - ms_delay_t ms_delay; - malloc_t k_malloc; - malloc_aligned_t k_malloc_aligned; - free_t k_free; - strcmp_t strcmp; - snk_call_t snk_call; - io_read_t io_read; - io_write_t io_write; - k_open_t k_open; - k_close_t k_close; - k_read_t k_read; - k_write_t k_write; - k_ioctl_t k_ioctl; - modules_remove_t modules_remove; - modules_load_t modules_load; -} snk_kernel_t; - -/* Entry of module */ -snk_module_t *module_init(snk_kernel_t * snk_kernel_int); - /* * Constants for different kinds of IOCTL requests diff --git a/clients/net-snk/kernel/init.c b/clients/net-snk/kernel/init.c index 9e6176c..77494fc 100644 --- a/clients/net-snk/kernel/init.c +++ b/clients/net-snk/kernel/init.c @@ -33,7 +33,7 @@ snk_fileio_t fd_array[FILEIO_MAX]; extern uint64_t tb_freq; -int glue_init(snk_kernel_t *, unsigned int *, size_t, size_t); +int glue_init(unsigned int *, size_t, size_t); void glue_release(void); extern char _lowmem_start; @@ -41,25 +41,6 @@ extern char _lowmem_end; extern char __client_start; extern char __client_end; -snk_kernel_t snk_kernel_interface = { - .version = 1, - .print = printk, - .us_delay = udelay, - .ms_delay = mdelay, - .k_malloc = malloc, - .k_malloc_aligned = malloc_aligned, - .k_free = free, - .strcmp = strcmp, - .snk_call = main, - .k_open = open, - .k_close = close, - .k_read = read, - .k_write = write, - .k_ioctl = ioctl, - .modules_remove = rmmod_by_type, - .modules_load = insmod_by_type, -}; - void * malloc_aligned(size_t size, int align) { unsigned long p = (unsigned long) malloc(size + align - 1); @@ -81,7 +62,7 @@ int _start_kernel(unsigned long p0, unsigned long p1) } /* this is step is e.g. resposible to initialize file descriptor 0 and 1 for STDIO */ - rc = glue_init(&snk_kernel_interface, &timebase, (size_t)(unsigned long)&__client_start, + rc = glue_init(&timebase, (size_t)(unsigned long)&__client_start, (size_t)(unsigned long)&__client_end - (size_t)(unsigned long)&__client_start); if(rc < 0) return -1; diff --git a/clients/net-snk/kernel/modules.c b/clients/net-snk/kernel/modules.c index 8bf546b..b37bcfe 100644 --- a/clients/net-snk/kernel/modules.c +++ b/clients/net-snk/kernel/modules.c @@ -29,8 +29,6 @@ extern char __client_start[]; snk_module_t *snk_modules[MODULES_MAX]; -extern snk_kernel_t snk_kernel_interface; - /* Load module and call init code. Init code will check, if module is responsible for device. Returns -1, if not responsible for device, 0 otherwise. @@ -41,9 +39,6 @@ modules_init(void) { int i; - snk_kernel_interface.io_read = read_io; - snk_kernel_interface.io_write = write_io; - snk_modules[0] = &of_module; /* Setup Module List */ diff --git a/clients/net-snk/oflib/ci_device.c b/clients/net-snk/oflib/ci_device.c index e490884..8b0636c 100644 --- a/clients/net-snk/oflib/ci_device.c +++ b/clients/net-snk/oflib/ci_device.c @@ -28,13 +28,11 @@ #define DEBUG 0 #if DEBUG -#define dprintf(str, ...) snk_kernel_interface.print(str, ## __VA_ARGS__) +#define dprintf(str, ...) printk(str, ## __VA_ARGS__) #else #define dprintf(str, ...) do{}while(0) #endif -extern snk_kernel_t snk_kernel_interface; - snk_module_t * cimod_check_and_install(void); static int cimod_init(void); static int cimod_term(void); diff --git a/clients/net-snk/oflib/of.c b/clients/net-snk/oflib/of.c index fcedffb..09f0be8 100644 --- a/clients/net-snk/oflib/of.c +++ b/clients/net-snk/oflib/of.c @@ -27,7 +27,7 @@ static int ofmod_read(char *buffer, int len); static int ofmod_write(char *buffer, int len); static int ofmod_ioctl(int request, void *data); -int glue_init(snk_kernel_t *, unsigned int *, size_t, size_t); +int glue_init(unsigned int *, size_t, size_t); void glue_release(void); snk_module_t of_module = { @@ -731,8 +731,8 @@ get_timebase(unsigned int *timebase) of_getprop(cpu, "timebase-frequency", timebase, 4); } -int glue_init(snk_kernel_t * snk_kernel_interface, unsigned int * timebase, - size_t _client_start, size_t _client_size) +int glue_init(unsigned int * timebase, + size_t _client_start, size_t _client_size) { phandle_t chosen = of_finddevice("/chosen"); diff --git a/clients/net-snk/oflib/rtas.c b/clients/net-snk/oflib/rtas.c index d0ef12a..1efb153 100644 --- a/clients/net-snk/oflib/rtas.c +++ b/clients/net-snk/oflib/rtas.c @@ -16,9 +16,7 @@ #include <rtas.h> #include <of.h> #include <netdriver_int.h> -#include "kernel.h" - -extern snk_kernel_t snk_kernel_interface; +#include <kernel.h> typedef int rtas_arg_t; @@ -103,7 +101,7 @@ instantiate_rtas(void) _rtas.dev = of_finddevice("/rtas"); if ((long) _rtas.dev < 0) { - snk_kernel_interface.print("\nCould not open /rtas\n"); + printk("\nCould not open /rtas\n"); return -1; } @@ -111,7 +109,7 @@ instantiate_rtas(void) sizeof(_rtas.rtas_size)); if (_rtas.rtas_size <= 0) { - snk_kernel_interface.print("\nSize of rtas (%x) too small to make sense\n", + printk("\nSize of rtas (%x) too small to make sense\n", _rtas.rtas_size); return -1; } @@ -119,14 +117,14 @@ instantiate_rtas(void) rtas_mem_space = (long long *) malloc_aligned(_rtas.rtas_size, 0x100); if (!rtas_mem_space) { - snk_kernel_interface.print("\nFailed to allocated memory for RTAS\n"); + printk("\nFailed to allocated memory for RTAS\n"); return -1; } ihandle = of_open("/rtas"); if ((long) ihandle < 0) { - snk_kernel_interface.print("Could not open /rtas\n"); + printk("Could not open /rtas\n"); return -1; } @@ -136,11 +134,11 @@ instantiate_rtas(void) > 0) { _rtas.rtas_start = rtas_mem_space; } else { - snk_kernel_interface.print("instantiate-rtas failed\n"); + printk("instantiate-rtas failed\n"); return -1; } #if 0 - snk_kernel_interface.print("\ninstantiate-rtas at %x size %x entry %x\n", + printk("\ninstantiate-rtas at %x size %x entry %x\n", _rtas.rtas_start, _rtas.rtas_size, _rtas.rtas_entry); #endif return 0; |