Skip to content

Commit 1c1c449

Browse files
committed
modify arch head file
1 parent 492bae0 commit 1c1c449

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+8607
-37
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ userspace netstack basic freebsd
55
基于f-stack的修改,源码来自freebsd11,整合多线程模式
66

77
编译方法:
8-
直接执行make
9-
默认的ARCH为x86_64,需要修改可以更改lib/machine_include/machine
8+
直接在uinet目录执行make
9+
1010

1111
运行方法:
1212
./example/helloworld -i ens38

uinet/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
all:
2-
if [ ! -d lib/machine_include/machine ];then cp -rf lib/machine_include/machine_x64 lib/machine_include/machine ;fi
32
make -C lib
43
make -C example
54

uinet/example/Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ ifeq ($(FF_PATH),)
44
FF_PATH=${TOPDIR}
55
endif
66

7-
ifeq ($(FF_DPDK),)
8-
FF_DPDK=${TOPDIR}/dpdk/x86_64-native-linuxapp-gcc
9-
endif
107

118
LIBS+= -L${FF_PATH}/lib -Wl,--whole-archive,-lfstack,--no-whole-archive
12-
#LIBS+= -L${FF_DPDK}/lib -Wl,--whole-archive,-ldpdk,--no-whole-archive
139
LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -pthread
14-
#LIBS+= -Wl,--no-whole-archive -lrt -lm -ldl -lcrypto -pthread -lnuma
1510

1611
TARGET="helloworld"
1712
all:

uinet/freebsd/kern/devfs_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ biofinish(struct bio *bp, void *stat, int error)
6767
void
6868
vfs_timestamp(struct timespec *tsp)
6969
{
70-
printf("%s %d\n",__func__,__LINE__);
70+
//printf("%s %d\n",__func__,__LINE__);
7171

7272
}
7373

uinet/freebsd/kern/kern_descrip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2446,7 +2446,7 @@ finit(struct file *fp, u_int flag, short type, void *data, struct fileops *ops)
24462446
fp->f_data = data;
24472447
fp->f_flag = flag;
24482448
fp->f_type = type;
2449-
atomic_store_rel_ptr((volatile uintptr_t *)&fp->f_ops, (uintptr_t)ops);
2449+
atomic_store_rel_ptr((volatile u_long *)&fp->f_ops, (uintptr_t)ops);
24502450
}
24512451

24522452
int

uinet/freebsd/kern/kern_fail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ fail_point_eval_nontrivial(struct fail_point *fp, int *return_value)
583583
case FAIL_POINT_BREAK:
584584
printf("fail point %s breaking to debugger\n",
585585
fp->fp_name);
586-
breakpoint();
586+
//breakpoint();
587587
break;
588588

589589
case FAIL_POINT_PRINT:

uinet/freebsd/kern/link_elf.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,19 +410,17 @@ link_elf_init(void* arg)
410410

411411
ef = (elf_file_t) linker_kernel_file;
412412
ef->preloaded = 1;
413-
#ifdef __powerpc__
414-
ef->address = (caddr_t) (__startkernel - KERNBASE);
415-
#else
413+
416414
ef->address = 0;
417-
#endif
415+
418416
#ifdef SPARSE_MAPPING
419417
ef->object = 0;
420418
#endif
421419
ef->dynamic = dp;
422420

423421
if (dp != NULL)
424422
parse_dynamic(ef);
425-
linker_kernel_file->address += KERNBASE;
423+
linker_kernel_file->address += 0;
426424
linker_kernel_file->size = -(intptr_t)linker_kernel_file->address;
427425

428426
if (modptr != NULL) {

uinet/freebsd/kern/pty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ ptydev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *fp)
9191
int error;
9292
char name[6]; /* "ttyXX" */
9393

94-
if (!atomic_cmpset_ptr((uintptr_t *)&dev->si_drv1, 0, 1))
94+
if (!atomic_cmpset_ptr((volatile u_long *)&dev->si_drv1, 0, 1))
9595
return (EBUSY);
9696

9797
/* Generate device name and create PTY. */

uinet/freebsd/kern/subr_lock.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,11 @@ lock_delay(struct lock_delay_arg *la)
124124
min = lc->min;
125125
if (backoff < min)
126126
backoff = min;
127+
/*
127128
for (i = 0; i < backoff; i++)
128129
cpu_spinwait();
129-
130+
*/
131+
130132
la->delay = delay;
131133
la->spin_cnt += backoff;
132134
}

uinet/freebsd/sys/buf_ring.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ buf_ring_enqueue(struct buf_ring *br, void *buf)
8080
cons_tail = br->br_cons_tail;
8181

8282
if (prod_next == cons_tail) {
83-
rmb();
83+
//rmb();
8484
if (prod_head == br->br_prod_head &&
8585
cons_tail == br->br_cons_tail) {
8686
br->br_drops++;
@@ -100,9 +100,12 @@ buf_ring_enqueue(struct buf_ring *br, void *buf)
100100
* If there are other enqueues in progress
101101
* that preceded us, we need to wait for them
102102
* to complete
103-
*/
103+
*/
104+
105+
/*
104106
while (br->br_prod_tail != prod_head)
105107
cpu_spinwait();
108+
*/
106109
atomic_store_rel_int(&br->br_prod_tail, prod_next);
107110
critical_exit();
108111
return (0);

0 commit comments

Comments
 (0)