mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-29 21:58:20 +00:00
kernel: remove some unescessary inits
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
#include <string.h>
|
||||
#include <logging.h>
|
||||
|
||||
static hashtable_t nametable;
|
||||
static mutex_t tablelock;
|
||||
HASHTABLE_DEFINE_STATIC(nametable, 10);
|
||||
static MUTEX_DEFINE(tablelock);
|
||||
|
||||
static devops_t devops = {0};
|
||||
|
||||
@@ -37,8 +37,3 @@ netdev_t *netdev_getdev(char *name) {
|
||||
MUTEX_RELEASE(&tablelock);
|
||||
return netdev;
|
||||
}
|
||||
|
||||
void netdev_init() {
|
||||
__assert(hashtable_init(&nametable, 10) == 0);
|
||||
MUTEX_INIT(&tablelock);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ typedef struct {
|
||||
#define ALLOC_RANGE_START 50000
|
||||
#define ALLOC_RANGE_END 60000
|
||||
static socket_t *ports[65536];
|
||||
static spinlock_t portlock;
|
||||
static SPINLOCK_DEFINE(portlock);
|
||||
|
||||
int udp_sendpacket(iovec_iterator_t *iovec_iterator, size_t size, uint32_t ip, uint16_t srcport, uint16_t dstport, netdev_t *broadcastnetdev) {
|
||||
void *newbuff = alloc(size + sizeof(udpframe_t));
|
||||
@@ -56,10 +56,6 @@ int udp_sendpacket(iovec_iterator_t *iovec_iterator, size_t size, uint32_t ip, u
|
||||
return error;
|
||||
}
|
||||
|
||||
void udp_init() {
|
||||
SPINLOCK_INIT(portlock);
|
||||
}
|
||||
|
||||
int udp_allocport(socket_t *socket, uint16_t *port) {
|
||||
bool intstate = interrupt_set(false);
|
||||
spinlock_acquire(&portlock);
|
||||
|
||||
Reference in New Issue
Block a user