Deleted Added
full compact
msgring.h (211994) msgring.h (211996)
1/*-
2 * Copyright (c) 2003-2009 RMI Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * RMI_BSD
1/*-
2 * Copyright (c) 2003-2009 RMI Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 13 unchanged lines hidden (view full) ---

22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * RMI_BSD
30 * $FreeBSD: head/sys/mips/rmi/msgring.h 211994 2010-08-30 13:05:21Z jchandra $
30 * $FreeBSD: head/sys/mips/rmi/msgring.h 211996 2010-08-30 13:26:07Z jchandra $
31 */
32#ifndef _RMI_MSGRING_H_
33#define _RMI_MSGRING_H_
34
35#include <sys/types.h>
36#include <mips/rmi/rmi_mips_exts.h>
37
38#define MSGRNG_TX_BUF_REG 0

--- 330 unchanged lines hidden (view full) ---

369 msgrng_load_tx_msg3(msg->msg3);
370
371 dest = ((size - 1) << 16) | (code << 8) | (stid);
372
373 msgrng_send(dest);
374
375 for (i = 0; i < 16; i++) {
376 status = msgrng_read_status();
31 */
32#ifndef _RMI_MSGRING_H_
33#define _RMI_MSGRING_H_
34
35#include <sys/types.h>
36#include <mips/rmi/rmi_mips_exts.h>
37
38#define MSGRNG_TX_BUF_REG 0

--- 330 unchanged lines hidden (view full) ---

369 msgrng_load_tx_msg3(msg->msg3);
370
371 dest = ((size - 1) << 16) | (code << 8) | (stid);
372
373 msgrng_send(dest);
374
375 for (i = 0; i < 16; i++) {
376 status = msgrng_read_status();
377 //dbg_msg("status = %Lx\n", status);
378
379 if (status & 0x6) {
380 continue;
381 } else
382 break;
383 }
377
378 if (status & 0x6) {
379 continue;
380 } else
381 break;
382 }
384 if (i == 16) {
385 if (dest == 0x61)
386 //dbg_msg("Processor %x: Unable to send msg to %llx\n", processor_id(), dest);
387 return status & 0x6;
388 }
389 return msgrng_read_status() & 0x06;
390}
391
392static __inline__ int
393message_send_retry(unsigned int size, unsigned int code,
394 unsigned int stid, struct msgrng_msg *msg)
395{
396 int res = 0;

--- 15 unchanged lines hidden (view full) ---

412
413 return 0;
414}
415
416static __inline__ int
417message_receive(int pri, int *size, int *code, int *src_id,
418 struct msgrng_msg *msg)
419{
383 return msgrng_read_status() & 0x06;
384}
385
386static __inline__ int
387message_send_retry(unsigned int size, unsigned int code,
388 unsigned int stid, struct msgrng_msg *msg)
389{
390 int res = 0;

--- 15 unchanged lines hidden (view full) ---

406
407 return 0;
408}
409
410static __inline__ int
411message_receive(int pri, int *size, int *code, int *src_id,
412 struct msgrng_msg *msg)
413{
420 int res = message_receive_fast(pri, *size, *code, *src_id, msg->msg0, msg->msg1, msg->msg2, msg->msg3);
421
422#ifdef MSGRING_DUMP_MESSAGES
423 if (!res) {
424 dbg_msg("Received msg <%llx, %llx, %llx, %llx> <%d,%d,%d>\n",
425 msg->msg0, msg->msg1, msg->msg2, msg->msg3,
426 *size, *code, *src_id);
427 }
428#endif
429
414 int res;
415
416 res = message_receive_fast(pri, *size, *code, *src_id,
417 msg->msg0, msg->msg1, msg->msg2, msg->msg3);
430 return res;
431}
432
433#define MSGRNG_STN_RX_QSIZE 256
434
435struct stn_cc {
436 unsigned short counters[16][8];
437};

--- 92 unchanged lines hidden ---
418 return res;
419}
420
421#define MSGRNG_STN_RX_QSIZE 256
422
423struct stn_cc {
424 unsigned short counters[16][8];
425};

--- 92 unchanged lines hidden ---