diff options
author | Visa Hankala <visa@cvs.openbsd.org> | 2017-11-04 11:18:18 +0000 |
---|---|---|
committer | Visa Hankala <visa@cvs.openbsd.org> | 2017-11-04 11:18:18 +0000 |
commit | 90821b2deeb71ed3b50ce3353b602b8058af0bc9 (patch) | |
tree | f386593ee20f38c3f0ff9a23e6dd5ab6ccfb767c /sys/arch/octeon | |
parent | 05b76f11527e17c2a5fc05557fd3bc3283934182 (diff) |
Use the macro for cache line size.
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r-- | sys/arch/octeon/dev/cn30xxfpa.c | 4 | ||||
-rw-r--r-- | sys/arch/octeon/dev/cn30xxfpavar.h | 4 | ||||
-rw-r--r-- | sys/arch/octeon/dev/cn30xxipd.c | 9 |
3 files changed, 9 insertions, 8 deletions
diff --git a/sys/arch/octeon/dev/cn30xxfpa.c b/sys/arch/octeon/dev/cn30xxfpa.c index 182bc844d7e..9fb69d64a33 100644 --- a/sys/arch/octeon/dev/cn30xxfpa.c +++ b/sys/arch/octeon/dev/cn30xxfpa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxfpa.c,v 1.7 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: cn30xxfpa.c,v 1.8 2017/11/04 11:18:17 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -201,7 +201,7 @@ cn30xxfpa_buf_dma_alloc(struct cn30xxfpa_buf *fb) if (status != 0) panic("%s failed", "bus_dmamap_create"); - status = bus_dmamem_alloc(fb->fb_dmat, fb->fb_len, 128, 0, + status = bus_dmamem_alloc(fb->fb_dmat, fb->fb_len, CACHELINESIZE, 0, fb->fb_dma_segs, fb->fb_dma_nsegs, &nsegs, 0); if (status != 0 || fb->fb_dma_nsegs != nsegs) panic("%s failed", "bus_dmamem_alloc"); diff --git a/sys/arch/octeon/dev/cn30xxfpavar.h b/sys/arch/octeon/dev/cn30xxfpavar.h index dc5fdfa9b91..c62b078da19 100644 --- a/sys/arch/octeon/dev/cn30xxfpavar.h +++ b/sys/arch/octeon/dev/cn30xxfpavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxfpavar.h,v 1.5 2017/11/04 10:59:43 visa Exp $ */ +/* $OpenBSD: cn30xxfpavar.h,v 1.6 2017/11/04 11:18:17 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. * All rights reserved. @@ -106,7 +106,7 @@ cn30xxfpa_buf_put_paddr(struct cn30xxfpa_buf *fb, paddr_t paddr) { KASSERT(paddr >= fb->fb_paddr); KASSERT(paddr < fb->fb_paddr + fb->fb_len); - cn30xxfpa_store(paddr, fb->fb_poolno, fb->fb_size / 128); + cn30xxfpa_store(paddr, fb->fb_poolno, fb->fb_size / CACHELINESIZE); } static inline void diff --git a/sys/arch/octeon/dev/cn30xxipd.c b/sys/arch/octeon/dev/cn30xxipd.c index d28b264315a..882cdaef66f 100644 --- a/sys/arch/octeon/dev/cn30xxipd.c +++ b/sys/arch/octeon/dev/cn30xxipd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cn30xxipd.c,v 1.9 2016/06/22 13:09:35 visa Exp $ */ +/* $OpenBSD: cn30xxipd.c,v 1.10 2017/11/04 11:18:17 visa Exp $ */ /* * Copyright (c) 2007 Internet Initiative Japan, Inc. @@ -132,12 +132,13 @@ cn30xxipd_config(struct cn30xxipd_softc *sc) _IPD_WR8(sc, IPD_PACKET_MBUFF_SIZE_OFFSET, packet_mbuff_size); first_next_ptr_back = 0; - SET(first_next_ptr_back, (sc->sc_first_mbuff_skip / 128) & IPD_1ST_NEXT_PTR_BACK_BACK); + SET(first_next_ptr_back, (sc->sc_first_mbuff_skip / CACHELINESIZE) + & IPD_1ST_NEXT_PTR_BACK_BACK); _IPD_WR8(sc, IPD_1ST_NEXT_PTR_BACK_OFFSET, first_next_ptr_back); second_next_ptr_back = 0; - SET(second_next_ptr_back, (sc->sc_not_first_mbuff_skip / 128) & - IPD_2ND_NEXT_PTR_BACK_BACK); + SET(second_next_ptr_back, (sc->sc_not_first_mbuff_skip / CACHELINESIZE) + & IPD_2ND_NEXT_PTR_BACK_BACK); _IPD_WR8(sc, IPD_2ND_NEXT_PTR_BACK_OFFSET, second_next_ptr_back); sqe_fpa_queue = 0; |