Skip to content

Commit

Permalink
Fix build for FreeBSD kernel.
Browse files Browse the repository at this point in the history
  • Loading branch information
caladri committed Nov 13, 2012
1 parent 7d9dd2a commit 9dea12b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/contrib/octeon-sdk/octeon-pci-console.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

/* The following code is only used in standalone CVMX applications. It does
not apply for kernel or Linux programming */
#if defined(OCTEON_TARGET) && !defined(__linux__)
#if defined(OCTEON_TARGET) && !defined(__linux__) && !defined(CVMX_BUILD_FOR_LINUX_KERNEL)

static int cvmx_pci_console_num = 0;
static int per_core_pci_consoles = 0;
Expand Down Expand Up @@ -110,14 +110,14 @@ int __cvmx_pci_console_write (int fd, char *buf, int nbytes)


#if !defined(CONFIG_OCTEON_U_BOOT) || (defined(CONFIG_OCTEON_U_BOOT) && (defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t wr_idx, uint32_t rd_idx)
static int octeon_pci_console_buffer_free_bytes(uint32_t buffer_size, uint32_t wr_idx, uint32_t rd_idx)
{
if (rd_idx >= buffer_size || wr_idx >= buffer_size)
return -1;

return (((buffer_size -1) - (wr_idx - rd_idx))%buffer_size);
}
int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, uint32_t wr_idx, uint32_t rd_idx)
static int octeon_pci_console_buffer_avail_bytes(uint32_t buffer_size, uint32_t wr_idx, uint32_t rd_idx)
{
if (rd_idx >= buffer_size || wr_idx >= buffer_size)
return -1;
Expand Down Expand Up @@ -287,7 +287,7 @@ int octeon_pci_console_host_read_avail(uint64_t console_desc_addr, unsigned int

/* This code is only available in a kernel or CVMX standalone. It can't be used
from userspace */
#if (!defined(CONFIG_OCTEON_U_BOOT) && (!defined(__linux__) || defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT) && (defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE)))
#if (!defined(CONFIG_OCTEON_U_BOOT) && (!defined(__linux__) || defined(__KERNEL__))) || (defined(CONFIG_OCTEON_U_BOOT) && (defined(CFG_PCI_CONSOLE) || defined(CONFIG_SYS_PCI_CONSOLE))) || defined(CVMX_BUILD_FOR_LINUX_KERNEL)

static octeon_pci_console_t *octeon_pci_console_get_ptr(uint64_t console_desc_addr, unsigned int console_num)
{
Expand Down

0 comments on commit 9dea12b

Please sign in to comment.